本文整理汇总了C++中NxMat33::rotZ方法的典型用法代码示例。如果您正苦于以下问题:C++ NxMat33::rotZ方法的具体用法?C++ NxMat33::rotZ怎么用?C++ NxMat33::rotZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NxMat33
的用法示例。
在下文中一共展示了NxMat33::rotZ方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplyVelocityToActor
NxVec3 ApplyVelocityToActor(NxActor* actor, const NxVec3& velDir, const NxReal velStrength, bool velMode)
{
NxVec3 velVec = velStrength*velDir;
if (velMode)
{
actor->moveGlobalPosition(actor->getGlobalPosition() + 0.0001*velStrength*velDir);
}
else
{
NxMat33 orient = actor->getGlobalOrientation();
NxMat33 m;
m.id();
if (velDir == NxVec3(1,0,0))
m.rotX(0.01);
else if (velDir == NxVec3(-1,0,0))
m.rotX(-0.01);
else if (velDir == NxVec3(0,1,0))
m.rotY(0.01);
else if (velDir == NxVec3(0,-1,0))
m.rotY(-0.01);
else if (velDir == NxVec3(0,0,1))
m.rotZ(0.01);
else if (velDir == NxVec3(0,0,-1))
m.rotZ(-0.01);
orient = m * orient;
actor->moveGlobalOrientation(orient);
}
return velVec;
}
示例2: SetupBunnyScene
void World::SetupBunnyScene()
{
NxSoftBodyDesc softBodyDesc;
softBodyDesc.globalPose.t = NxVec3(0,35,-1);
softBodyDesc.particleRadius = 0.2f;
softBodyDesc.volumeStiffness = 1.0f;
softBodyDesc.stretchingStiffness = 0.07f;
softBodyDesc.friction = 1.0f;
char *fileName = "bunny";
char tetFileName[256], objFileName[256], s[256];
sprintf(tetFileName, "%s.tet", fileName);
sprintf(objFileName, "%s.obj", fileName);
ObjMesh *objMesh = new ObjMesh(); // it is for mesh surface rendering
objMesh->loadFromObjFile(FindMediaFile(objFileName, s));
MySoftBody *softBody = new MySoftBody(gScene, softBodyDesc, FindMediaFile(tetFileName,s), objMesh);
if (!softBody->getNxSoftBody())
{
printf("Error: Unable to create the SoftBody for the current scene.\n");
delete softBody;
} else
{
gSoftBodies.push_back(softBody); // soft body is pushed to list.
gObjMeshes.push_back(objMesh); // surface mesh is pushed to list.
}
NxMat33 rot;
NxActor *plate0 = CreateBox(NxVec3(-2.5,10,0), NxVec3(20.0f, 1.0f, 10.0f), 0,0.0f);
rot.rotZ(1.5f);
plate0->setGlobalOrientation(rot);
NxActor *plate1 = CreateBox(NxVec3(2.5,10,0), NxVec3(20.0f, 1.0f, 10.0f), 0,0.0f);
rot.rotZ(1.5f);
plate1->setGlobalOrientation(rot);
// set camera position and direction
gCameraPos.set(-5.0f, 40.0f, 35.0f);
gCameraForward.set(0.2,-1.1,-2);
gCameraForward.normalize();
}
示例3: posMat
pRigidBody*pFactory::createBody(CK3dEntity *referenceObject,CK3dEntity *worldReferenceObject,NXU::NxActorDesc *desc,int flags)
{
#ifdef _DEBUG
assert(referenceObject);
assert(desc);
#endif
/************************************************************************/
/*
*/
/************************************************************************/
VxVector vpos;
referenceObject->GetPosition(&vpos);
VxQuaternion vquat;
referenceObject->GetQuaternion(&vquat);
NxQuat nrot = desc->globalPose.M;
NxVec3 npos = desc->globalPose.t;
NxMat33 rotX;
rotX.rotX( PI / 2.0f );
NxMat33 rotZ;
rotZ.rotZ( PI );
NxMat34 rotMat;
rotMat.M.multiply( rotZ, rotX );
NxMat34 posMat( true );
/* posMat.t.set( -mTerrain->getPosition().x,
mTerrain->getPosition().y,
mTerrain->getPosition().z );
*/
desc->globalPose.multiply( posMat, rotMat );
NxQuat nrot2 = desc->globalPose.M;
NxVec3 npos2 = desc->globalPose.t;
VxQuaternion nvm = getFromStream(nrot);
VxVector nvpos = getFromStream(npos);
for (NxU32 k=0; k<desc->mShapes.size(); k++)
{
NXU::NxShapeDesc *shape = desc->mShapes[k];
NxVec3 locPos = shape->localPose.t;
NxQuat localQuad = shape->localPose.M;
}
int op = 2;
return NULL;
}