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


C++ Matrix4x4::GetLeftVector方法代码示例

本文整理汇总了C++中Matrix4x4::GetLeftVector方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4x4::GetLeftVector方法的具体用法?C++ Matrix4x4::GetLeftVector怎么用?C++ Matrix4x4::GetLeftVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Matrix4x4的用法示例。


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

示例1: CharacterMovement

void CCharacterController::CharacterMovement(btCollisionWorld* pCollisionWorld, btScalar deltaTime)
{
	// Grab the new player transform before doing movement steps in case the player has been moved,
	// such as by a platform or teleported. No need to do a physics trace for it, the penetration
	// functions should handle that.
	btTransform mCharacter;
	CPhysicsEntity* pPhysicsEntity = static_cast<CBulletPhysics*>(GamePhysics())->GetPhysicsEntity(m_hEntity);
	pPhysicsEntity->m_oMotionState.getWorldTransform(mCharacter);

#ifdef _DEBUG
	Matrix4x4 mTest;
	mCharacter.getOpenGLMatrix(mTest);
	TAssert(mTest.GetForwardVector().Cross(mTest.GetLeftVector()).Equals(mTest.GetUpVector(), 0.001f));

	TAssert(mTest.GetUpVector().Equals(m_hEntity->GetUpVector(), 0.001f));
#endif

	m_pGhostObject->setWorldTransform(mCharacter);

	PreStep(pCollisionWorld);

	if (m_hEntity->IsFlying())
		PlayerFly(pCollisionWorld, deltaTime);
	else if (!m_hEntity->GetGroundEntity())
		PlayerFall(pCollisionWorld, deltaTime);
	else
		PlayerWalk(pCollisionWorld, deltaTime);

	FindGround(pCollisionWorld);

	btVector3 vecOrigin = m_pGhostObject->getWorldTransform().getOrigin();

	TAssert(vecOrigin.x() < 999999);
	TAssert(vecOrigin.x() > -999999);
	TAssert(vecOrigin.y() < 999999);
	TAssert(vecOrigin.y() > -999999);
	TAssert(vecOrigin.z() < 999999);
	TAssert(vecOrigin.z() > -999999);

	if ((mCharacter.getOrigin() - vecOrigin).length2() > 0.0001f)
		pPhysicsEntity->m_oMotionState.setWorldTransform(m_pGhostObject->getWorldTransform());
}
开发者ID:BSVino,项目名称:Digitanks,代码行数:42,代码来源:character_controller.cpp


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