• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetTransform函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetTransform

void Camera::OneFrame(float delta) {

	InputSystem &is = *Engine::GetSingleton()->GetInputSystem();
	int delta_x = is.GetMouseXMove();
	int delta_y = is.GetMouseYMove();
		
	GetTransform()->Rotate(delta_x/1000.0f,  -delta_y/1000.0f, 0.0f);
	
	if(mouse_reset) {
		float mouse_x_p = is.GetMouseXPercent(), mouse_y_p = is.GetMouseYPercent();
		if(mouse_x_p<0.4f || mouse_x_p>0.6f || mouse_y_p<0.4f || mouse_y_p>0.6f ) {
			is.SetMousePositionPercent(0.5f, 0.5f);
		}
	}


	if(is.IsKeyDown(InputSystem::K_W)) {
		TranslateForward(20.0f*delta);
	} else if(is.IsKeyDown(InputSystem::K_S)) {
		TranslateForward(-20.0f*delta);
	}
	if(is.IsKeyDown(InputSystem::K_D)) {
		TranslateRight(20.0f*delta);
	} else if(is.IsKeyDown(InputSystem::K_A)) {
		TranslateRight(-20.0f*delta);
	}
}
开发者ID:weidaru,项目名称:engine,代码行数:27,代码来源:camera.cpp


示例17: GetActorLocation

void AMobileEnemy::BeginPlay() {
  Super::BeginPlay();
  m_totalDistance = RightDistance + LeftDistance;
  m_currentDistance = LeftDistance;
  m_actualJumpSpeed = 0.0f;
  m_capsuleHeight = CapsuleComponent->GetScaledCapsuleHalfHeight();
  m_capsuleRadious = CapsuleComponent->GetScaledCapsuleRadius();
  m_capsuleHeightPadding = m_capsuleHeight * PADDING_ENEMY_COLLISION_PERCENT;
  m_capsuleRadiousPadding = m_capsuleRadious * 0.55f;
  m_lastPosition = GetActorLocation();
  m_nextPosition = m_lastPosition;
  m_rightVector = GetActorRightVector();
  {
    FVector right = GetActorRightVector();
    right = right;
    m_rightPosition = (m_lastPosition + RightDistance * right) * right;
    m_leftPosition = (m_lastPosition + LeftDistance * -right) * right;
  }
  m_isMoving = !HasTrigger;
  m_initialMovement = m_isMoving;
  m_initialStatus = GetTransform();
  if (Fly)
    m_enableGravity = false;
  RegisterDelegate();
}
开发者ID:alfreSosa,项目名称:PC-TowardsTheLight,代码行数:25,代码来源:MobileEnemy.cpp


示例18: FObjectAction

void ABrainNormalInteractiveObject::BeginPlay()
{
	Super::BeginPlay();

	int8 flags = (_canBeRotate ? EAction::ROTATE : 0)
		| (_canBeTranslate ? EAction::TRANSLATE : 0)
		| (_canBeScale ? EAction::SCALE : 0)
		| (_canBeShear ? EAction::SHEAR : 0);
	_actions = FObjectAction(flags);

	// Init Rotate
	_currentRotation = GetActorRotation();
	_targetRotation = GetActorRotation();

	// Init Translate
	_currentTranslation = GetActorLocation();
	_targetTranslation = GetActorLocation();

	// Init Scale
	_targetScale = _initScale;
	_currentScale = _initScale;

	// Init Shear
	_currentShearFirstAxis = 0;
	_currentShearSecondAxis = 0;
	_targetShearFirstAxis = 0;
	_targetShearSecondAxis = 0;

	_cachedTransform = GetTransform();

	if (this->GetClass()->ImplementsInterface(UBrainSaveInterface::StaticClass()))
		Load();
}
开发者ID:gamer08,项目名称:prog,代码行数:33,代码来源:BrainNormalInteractiveObject.cpp


示例19: GetTransform

void Blast::OnTriggerStay(EDGameCore::ICollider* thisCollider, EDGameCore::ICollider* otherCollider, const EDCollision::Contact& contact)
{
	if( otherCollider->GetAttachedRigidBody() != 0 )
	{
		EDCollision::Contact contact2 = contact;
		
		Float3 delta = otherCollider->GetTransform()->GetWorldMatrix().WAxis - GetTransform()->GetWorldMatrix().WAxis;

		if( DotProduct( delta, contact.Normal ) < 0.0f )
			contact2.negate();

		float mag = delta.magnitude();

		if( mag == 0.0f )
		{
			delta = Float3(0.0f, 1.0f, 0.0f);
			mag = 1.0f;
		}
		else
			delta *= (1.0f / mag);

		delta *= 15000.0f / (mag*mag);
		delta *= (1.0f / EDGameCore::Game::GetDeltaTime());

		otherCollider->GetAttachedRigidBody()->ApplyForceAtPoint( delta, contact2.Point[0] );
	}
}
开发者ID:Burnsidious,项目名称:FSGDEngine,代码行数:27,代码来源:Blast.cpp


示例20: Subdivide

/*! Subdivides the mesh uniformly one step
*/
void LoopSubdivisionMesh::Subdivide()
{
  // Create new mesh and copy all the attributes
  HalfEdgeMesh subDivMesh;
  subDivMesh.SetTransform(GetTransform());
  subDivMesh.SetName(GetName());
  subDivMesh.SetColorMap(GetColorMap());
  subDivMesh.SetWireframe(GetWireframe());
  subDivMesh.SetShowNormals(GetShowNormals());
  subDivMesh.SetOpacity(GetOpacity());
  if (IsHovering()) subDivMesh.Hover();
  if (IsSelected()) subDivMesh.Select();
  subDivMesh.mMinCMap = mMinCMap;
  subDivMesh.mMaxCMap = mMaxCMap;
  subDivMesh.mAutoMinMax = mAutoMinMax;


  // loop over each face and create 4 new ones
  for (unsigned int i=0; i<mFaces.size(); i++){
    // subdivide face
    std::vector< std::vector<Vector3<float> > > faces = Subdivide(i);

    // add new faces to subDivMesh
    for(unsigned int j=0; j<faces.size(); j++){
      subDivMesh.AddFace(faces.at(j));
    }
  }

  // Assigns the new mesh
  *this = LoopSubdivisionMesh(subDivMesh, ++mNumSubDivs);
  Update();
}
开发者ID:marcusstenbeck,项目名称:tnm079-labs,代码行数:34,代码来源:LoopSubdivisionMesh.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetTransientPackage函数代码示例发布时间:2022-05-30
下一篇:
C++ GetTransactionSnapshot函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap