本文整理汇总了C++中NxMat33::getColumn方法的典型用法代码示例。如果您正苦于以下问题:C++ NxMat33::getColumn方法的具体用法?C++ NxMat33::getColumn怎么用?C++ NxMat33::getColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NxMat33
的用法示例。
在下文中一共展示了NxMat33::getColumn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TickCar
void TickCar()
{
NxReal steeringAngle = gSteeringValue * gMaxSteeringAngle;
NxArray<CarWheelContact>::iterator i = wheelContactPoints.begin();
while(i != wheelContactPoints.end())
{
CarWheelContact& cwc = *i;
WheelShapeUserData* wheelData = (WheelShapeUserData *)(cwc.wheel->userData);
//apply to powered wheels only.
if (wheelData->frontWheel)
{
//steering:
NxMat33 wheelOrientation = cwc.wheel->getLocalOrientation();
wheelOrientation.setColumn(0, NxVec3(NxMath::cos(steeringAngle), 0, NxMath::sin(steeringAngle) ));
wheelOrientation.setColumn(2, NxVec3(NxMath::sin(steeringAngle), 0, -NxMath::cos(steeringAngle) ));
cwc.wheel->setLocalOrientation(wheelOrientation);
if (frontWheelIsPowered)
{
//get the world space orientation:
wheelOrientation = cwc.wheel->getGlobalOrientation();
NxVec3 steeringDirection;
wheelOrientation.getColumn(0, steeringDirection);
//the power direction of the front wheel is the wheel's axis as it is steered.
if (gMotorForce)
{
cwc.car->addForceAtPos(steeringDirection * gMotorForce,cwc.contactPoint);
}
}
}
if (!wheelData->frontWheel && rearWheelIsPowered)
{
//get the orientation of this car:
NxMat33 m = cwc.car->getGlobalOrientation();
NxVec3 carForwardAxis;
m.getColumn(0, carForwardAxis);
//the power direction of the rear wheel is always the car's length axis.
cwc.car->addForceAtPos(carForwardAxis * gMotorForce,cwc.contactPoint);
}
i++;
}
wheelContactPoints.clear();
}
示例2: HitCheck
/*===========================================================*/
bool CLaserBase::HitCheck( float *Distance )
{
// レイを飛ばす場所
NxVec3 orig = m_pd3d->GetCamPos();
// レイの飛ばす方向
NxVec3 dir;
NxMat33 m;
CMatrix mRot;
mRot.SetRotate( m_pd3d->GetCamRot() );
NxF64 Tmp[3][3];
CDPConverter::SetMatrix( Tmp , &mRot );
m.setColumnMajor( Tmp );
m.getColumn( 2 , dir );
NxRay ray( orig , dir );
NxRaycastHit hit;
NxReal dist;
// レイ発射
NxShape* closestShape = m_pPhysX->GetScene()->raycastClosestShape( ray , NX_ALL_SHAPES , hit , ( 1<<CPhysX::CG_DEFAULT ) | ( 1<<CPhysX::CG_HEAVY_OBJECT ) | ( 1<<CPhysX::CG_STATIC ) );
if( closestShape )
{
m_pHitActor = &hit.shape->getActor();
NxVec3& worldImpact = hit.worldImpact;
dist = hit.distance;
*Distance = hit.distance;
CRaycastLine rl( ray.orig , worldImpact , 0xffffffff );
RayPos = rl;
return true;
}
else
{
dist = 10000;
*Distance = 10000;
CRaycastLine rl( ray.orig , dist*dir , 0xffffffff );
RayPos = rl;
return false;
}
}
示例3: TickCar
void TickCar ( void )
{
g_iValue = 10;
NxReal steeringAngle = gSteeringValue * gMaxSteeringAngle;
NxArray<CarWheelContact>::iterator i = wheelContactPoints.begin();
while(i != wheelContactPoints.end())
{
CarWheelContact& cwc = *i;
WheelShapeUserData* wheelData = (WheelShapeUserData *)(cwc.wheel->userData);
/*
struct CarWheelContact
{
NxActor* car;
NxShape* wheel;
NxVec3 contactPoint;
NxVec3 contactNormalForce;
NxVec3 contactFrictionForce;
};
*/
{
NxMat34 pose = cwc.wheel->getGlobalPose ( );
NxMat33 orient = pose.M;
NxVec3 pos = pose.t;
float glmat[16];
orient.getColumnMajorStride4(&(glmat[0]));
pos.get(&(glmat[12]));
glmat[3] = glmat[7] = glmat[11] = 0.0f;
glmat[15] = 1.0f;
SetWorldMatrix ( g_iValue, ( D3DXMATRIX* ) &glmat );
sObject* pObject = dbGetObject ( g_iValue );
pObject->position.vecPosition = D3DXVECTOR3 ( glmat [ 12 ], glmat [ 13 ], glmat [ 14 ] );
//dbPositionObject ( g_iValue, glmat [ 12 ], glmat [ 13 ], glmat [ 14 ] );
g_iValue++;
}
//apply to powered wheels only.
if (wheelData->frontWheel)
{
//steering:
NxMat33 wheelOrientation = cwc.wheel->getLocalOrientation();
wheelOrientation.setColumn(0, NxVec3(NxMath::cos(steeringAngle), 0, NxMath::sin(steeringAngle) ));
wheelOrientation.setColumn(2, NxVec3(NxMath::sin(steeringAngle), 0, -NxMath::cos(steeringAngle) ));
cwc.wheel->setLocalOrientation(wheelOrientation);
if (frontWheelIsPowered)
{
//get the world space orientation:
wheelOrientation = cwc.wheel->getGlobalOrientation();
NxVec3 steeringDirection;
wheelOrientation.getColumn(0, steeringDirection);
//the power direction of the front wheel is the wheel's axis as it is steered.
if (gMotorForce)
{
cwc.car->addForceAtPos(steeringDirection * gMotorForce,cwc.contactPoint);
}
}
}
if (!wheelData->frontWheel && rearWheelIsPowered)
{
//get the orientation of this car:
NxMat33 m = cwc.car->getGlobalOrientation();
NxVec3 carForwardAxis;
m.getColumn(0, carForwardAxis);
//the power direction of the rear wheel is always the car's length axis.
cwc.car->addForceAtPos(carForwardAxis * gMotorForce,cwc.contactPoint);
}
i++;
}
wheelContactPoints.clear();
}