当前位置: 首页>>代码示例>>C++>>正文


C++ GetTransform函数代码示例

本文整理汇总了C++中GetTransform函数的典型用法代码示例。如果您正苦于以下问题:C++ GetTransform函数的具体用法?C++ GetTransform怎么用?C++ GetTransform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetTransform函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetClientRect

void CTinyCadView::SetScrollCentre(CDPoint c)
{
	CRect rect;
	CDPoint p;

	GetClientRect(rect);
	p = GetTransform().DeScale(GetCurrentDocument()->m_snap, CPoint(rect.right / 2, rect.bottom / 2));
	SetScroll(GetTransform().GetOrigin().x + c.x - p.x, GetTransform().GetOrigin().y + c.y - p.y);
}
开发者ID:soloveyhappy,项目名称:tiny,代码行数:9,代码来源:Paint.cpp

示例2: GetTransform

void VelocityRotator::Update(float dt)
{
	if (body != nullptr)
	{
		XMFLOAT3 rot = GetTransform().GetRotation();
		XMFLOAT4 velo = body->GetVelocity();
		rot.z -= velo.x * speedScale * dt;
		rot.x += velo.z * speedScale * dt;
		GetTransform().SetRotation(rot);
	}
}
开发者ID:QRayarch,项目名称:ShootyBally,代码行数:11,代码来源:VelocityRotator.cpp

示例3: CameraComponent

void FixedCamera::Initialize()
{
	//Camera Component
	m_pCamera = new CameraComponent();
	AddComponent(m_pCamera);

	GetTransform()->Translate(2.5, -2, -2.5f);

	GetTransform()->RotateEuler(0, glm::radians(45.f), 0);
	GetTransform()->RotateEuler(glm::radians(20.f), 0, glm::radians(20.f));
}
开发者ID:Illation,项目名称:GLFramework,代码行数:11,代码来源:FixedCamera.cpp

示例4: GetTransform

Matrix4f Camera::GetViewProjection() const
{
	//This comes from the conjugate rotation because the world should appear to rotate
	//opposite to the camera's rotation.
	Matrix4f cameraRotation = GetTransform().GetTransformedRot().Conjugate().ToRotationMatrix();
	
	//Similarly, the translation is inverted because the world appears to move opposite
	//to the camera's movement.
	Matrix4f cameraTranslation = Matrix4f().InitTranslation(GetTransform().GetTransformedPos() * -1);
	
	return m_projection * cameraRotation * cameraTranslation;
}
开发者ID:MrShedman,项目名称:GL-Dev,代码行数:12,代码来源:camera.cpp

示例5: GetTransform

void FreeLook::ProcessInput(const Input& input, float delta)
{
	if (input.GetKeyUp(Input::KEY_LEFT))
	{
		GetTransform()->Rotate(PxQuat(ToRadians(-90.0f), PxVec3(0, 1, 0)));
	}

	if (input.GetKeyUp(Input::KEY_RIGHT))
	{
		GetTransform()->Rotate(PxQuat(ToRadians(90.0f), PxVec3(0, 1, 0)));
	}

}
开发者ID:KumaKing,项目名称:Sem5AliMaze,代码行数:13,代码来源:FreeLook.cpp

示例6: GetTransform

void TransformNDOF::GetJacobian(const scalarArray &q, se3Array &J)
{
	SE3 T = GetTransform(q);
	scalarArray dq(m_iDOF);
	for ( int i = 0; i < m_iDOF; i++ ) dq[i] = q[i];

	for ( int i = 0; i < m_iDOF; i++ )
	{
		dq[i] += m_rEPS;
		J[i] = (SCALAR_1 / m_rEPS) * Linearize(T % GetTransform(dq));
		dq[i] -= m_rEPS;
	}
}
开发者ID:snumrl,项目名称:DataDrivenBipedController,代码行数:13,代码来源:vpNDOFJoint.cpp

示例7: GetTransform

void ABaseCharacter::CheckAttackOverlap(){

	//Overlapping actors for each box spawned will be stored here
	TArray<struct FOverlapResult> OutActorOverlaps;

	//Hit other actors only once
	TArray<AActor*> ProcessedActors;


	//The initial rotation of our box is the same as our character rotation
	FQuat Rotation = GetTransform().GetRotation();
	FVector Start = GetTransform().GetLocation() + Rotation.Rotator().Vector() * 100.0f;

	FCollisionShape CollisionHitShape;
	FCollisionQueryParams CollisionParams;

	//We do not want the character to hit itself, don't store this character in the array, to ignore it's collision
	CollisionParams.AddIgnoredActor(this);

	//Set the channels that will respond to the collision
	FCollisionObjectQueryParams CollisionObjectTypes;
	CollisionObjectTypes.AddObjectTypesToQuery(ECollisionChannel::ECC_PhysicsBody);
	CollisionObjectTypes.AddObjectTypesToQuery(ECollisionChannel::ECC_Pawn);
	//CollisionObjectTypes.AddObjectTypesToQuery(ECollisionChannel::ECC_WorldStatic); // uncomment to enable bashing objects

	//Create the box and get the overlapping actors
	CollisionHitShape = FCollisionShape::MakeBox(AttackBox);
	GetWorld()->OverlapMulti(OutActorOverlaps, Start, Rotation, CollisionHitShape, CollisionParams, CollisionObjectTypes);


	AActor* ActorToProcess;
	//Process all hit actors
	for (int i = 0; i < OutActorOverlaps.Num(); ++i)
	{
		ActorToProcess = OutActorOverlaps[i].GetActor();
		//We process each actor only once per Attack execution
		if (ActorToProcess && !ProcessedActors.Contains(ActorToProcess))
		{

			//Add this actor to the array because we are spawning one box per tick and we don't want to hit the same actor twice during the same attack animation
			ProcessedActors.AddUnique(ActorToProcess);

			if ( dynamic_cast<APatrollingEnemyCharacter*>(ActorToProcess) ){
				APatrollingEnemyCharacter* ennemy = (APatrollingEnemyCharacter*)ActorToProcess;
				ennemy->OnHit(this);
			}
		}
	}
}
开发者ID:trinitea,项目名称:NightmareNeverEnds,代码行数:49,代码来源:BaseCharacter.cpp

示例8: GetTransform

void ABomb::SimulateExplosionFX_Implementation()
{
	if (ExplosionFX)
	{
		UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), ExplosionFX, GetTransform(), true);
	}
}
开发者ID:orfeasel,项目名称:UE4-Game-Systems,代码行数:7,代码来源:Bomb.cpp

示例9: GetOpenGLContext

//TODO: need refine!!!
void ctLineBorders::Draw()
{
    //if(!rectDotIndexes) return;
    //glDisable(GL_DEPTH_TEST);
    GetOpenGLContext()->functions()->glBindBuffer(GL_ARRAY_BUFFER, meshVBO);

    if (posAtribLoc != -1)
    {
        GetOpenGLContext()->functions()->glVertexAttribPointer(posAtribLoc, 3, GL_FLOAT, GL_FALSE,
            (3 * sizeof(GLfloat)), (const GLvoid*)0);
        GetOpenGLContext()->functions()->glEnableVertexAttribArray(posAtribLoc);
    }
    else
    {qDebug()<<"isShit pos!!!";}

    m_currentShader->bind();

    m_currentShader->setUniformValue(matrixUniform, GetProjectionMatrix().GetMatrix());
    m_currentShader->setUniformValue(materialUniform, GetMaterial()->GetRGBA());
    m_currentShader->setUniformValue(transformMatrixUniform, GetTransform()->GetGlobalTransformMatrix().GetMatrix());

    glDrawElements(GL_LINE_LOOP, m_dots.count(), GL_UNSIGNED_SHORT, planeIndexes);

    GetOpenGLContext()->functions()->glBindBuffer(GL_ARRAY_BUFFER, 0);
    m_currentShader->release();
}
开发者ID:vdoom,项目名称:TestAssignment,代码行数:27,代码来源:ctLineBorders.cpp

示例10: GetTransform

void
GeometryGroup::Draw (cairo_t *cr)
{
	Transform *transform = GetTransform ();
	cairo_matrix_t saved;
	cairo_get_matrix (cr, &saved);

	if (transform) {
		cairo_matrix_t matrix;
		transform->GetTransform (&matrix);
		cairo_transform (cr, &matrix);
	}
	
	GeometryCollection *children = GetChildren ();
	Geometry *geometry;

	// GeometryGroup is used for Clip (as a Geometry) so Fill (normally setting the fill rule) is never called
	cairo_set_fill_rule (cr, convert_fill_rule (GetFillRule ()));
	
	int children_count = children->GetCount ();
	for (int i = 0; i < children_count; i++) {
		geometry = children->GetValueAt (i)->AsGeometry ();
		
		geometry->Draw (cr);
	}
	
	cairo_set_matrix (cr, &saved);
}
开发者ID:kangaroo,项目名称:moon,代码行数:28,代码来源:geometry.cpp

示例11: UNREFERENCED_PARAMETER

void Iglo::Initialize(const GameContext& gameContext)
{
	UNREFERENCED_PARAMETER(gameContext);

	// ADD MODEL
	auto physX = PhysxManager::GetInstance()->GetPhysics();

	auto igloModelComponent = new ModelComponent(L"./Resources/Meshes/Iglo.ovm");

	auto igloMaterial = new DiffuseMaterial();
	igloMaterial->SetDiffuseTexture(L"./Resources/Textures/Iglo.jpg");
	gameContext.pMaterialManager->AddMaterial(igloMaterial, 1);

	igloModelComponent->SetMaterial(1);

	AddComponent(igloModelComponent);

	auto rigidbody = new RigidBodyComponent();
	rigidbody->SetKinematic(true);
	AddComponent(rigidbody);

	auto defaultMaterial = physX->createMaterial(0.5f, 0.5f, 0.1f);
	auto igloMesh = ContentManager::Load<PxTriangleMesh>(L"./Resources/Meshes/Iglo.ovpt");
	shared_ptr<PxGeometry> igloGeo(new PxTriangleMeshGeometry(igloMesh));
	auto IgloCollider = new ColliderComponent(igloGeo, *defaultMaterial);

	AddComponent(IgloCollider);

	GetTransform()->Translate(m_Position);
}
开发者ID:BartyTurbo,项目名称:Arctic-Defence-3D-,代码行数:30,代码来源:Iglo.cpp

示例12: LoadTexture

void Cube::Render(LPDIRECT3DDEVICE9 pd3dDevice, DWORD dwAttribId) {
    // Set texture
    if (!m_pTexture) {
        m_pTexture = LoadTexture(pd3dDevice, "snow.bmp");
    }
    std::map<int, DWORD> mDwRenderState;
    pd3dDevice->SetTransform(D3DTS_WORLD, GetTransform());
    if (m_bBlending) {
        DWORD dwState;
        pd3dDevice->GetRenderState(D3DRS_ALPHABLENDENABLE, &dwState);
        mDwRenderState[D3DRS_SRCBLEND] = dwState;
        pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);

        pd3dDevice->GetRenderState(D3DRS_SRCBLEND, &dwState);
        mDwRenderState[D3DRS_SRCBLEND] = dwState;
        pd3dDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);

        pd3dDevice->GetRenderState(D3DRS_DESTBLEND, &dwState);
        mDwRenderState[D3DRS_DESTBLEND] = dwState;
        pd3dDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
    } /*else {
        pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
        pd3dDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
    }  */  
    pd3dDevice->SetMaterial(&m_d3dMaterial);
    pd3dDevice->SetTexture(0, m_pTexture);
    m_pMesh->DrawSubset(dwAttribId);

    if (m_bBlending) {
        for (auto &it : mDwRenderState) {
            pd3dDevice->SetRenderState((D3DRENDERSTATETYPE)it.first, it.second);
        }
    }
}
开发者ID:H56,项目名称:Snowman,代码行数:34,代码来源:Cube.cpp

示例13: OnTick

	void AudioListener::OnTick()
	{
		if (!m_audio)
			return;

		m_audio->SetListenerTransform(GetTransform());
	}
开发者ID:PanosK92,项目名称:Directus3D,代码行数:7,代码来源:AudioListener.cpp

示例14: GetTransform

	void Camera::UpdateMatrix()
	{
		int width = Screen::GetWidth();
		int height = Screen::GetHeight();
		auto transform = GetTransform();

		m_view_matrix = Matrix4x4::LookTo(
			transform->GetPosition(),
			transform->GetForward(),
			transform->GetUp());
		
		if(!m_orthographic)
		{
			m_projection_matrix = Matrix4x4::Perspective(m_field_of_view, width / (float) height, m_near_clip_plane, m_far_clip_plane);
		}
		else
		{
			float top = m_orthographic_size;
			float bottom = -m_orthographic_size;
			float plane_h = m_orthographic_size * 2;
			float plane_w = plane_h * (width * m_rect.width) / (height * m_rect.height);
			m_projection_matrix = Matrix4x4::Ortho(-plane_w/2, plane_w/2, bottom, top, m_near_clip_plane, m_far_clip_plane);
		}

		m_view_projection_matrix = m_projection_matrix * m_view_matrix;
	}
开发者ID:JCGit,项目名称:Galaxy3D,代码行数:26,代码来源:Camera.cpp

示例15: GetTransform

void CInstanceMesh::Render()
{
  if ( !mStaticMesh || !GetActive() )
    return;

  Math::Mat44f lTransform = GetTransform();
  mCenter = lTransform* mStaticMesh->GetAABB().GetCenter();

  if( mIsDynamic )
  {    
      mPhysicActor->GetMat44( lTransform );
      Math::Vect3f lUp( 0.0f, -mStaticMesh->GetAABB().GetCenter().y, 0.0f );

      Math::Mat44f lCenterTransform;
      lCenterTransform.SetIdentity();

      lCenterTransform.Translate( lUp );
      lTransform = lTransform * lCenterTransform;
  }

  CFrustum lCameraFrustum = CameraMInstance->GetCurrentCamera()->GetFrustum();
  CGraphicsManager* lGM = GraphicsInstance;
  if ( lCameraFrustum.SphereVisible( D3DXVECTOR3( mCenter.u ), mRadius ) )
  {
    lGM ->SetTransform( lTransform );
    mStaticMesh->Render( lGM  );
    lGM ->SetTransform( Math::Mat44f() );
  }
}
开发者ID:mvuab-g1-14-15,项目名称:AlmostHuman,代码行数:29,代码来源:InstanceMesh.cpp


注:本文中的GetTransform函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。