本文整理汇总了C++中PfxShape::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ PfxShape::reset方法的具体用法?C++ PfxShape::reset怎么用?C++ PfxShape::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PfxShape
的用法示例。
在下文中一共展示了PfxShape::reset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createSceneLandscape
void createSceneLandscape()
{
PfxCreateLargeTriMeshParam param;
param.verts = LargeMeshVtx;
param.numVerts = LargeMeshVtxCount;
param.vertexStrideBytes = sizeof(float)*6;
param.triangles = LargeMeshIdx;
param.numTriangles = LargeMeshIdxCount/3;
param.triangleStrideBytes = sizeof(unsigned short)*3;
if(gLargeMesh.m_numIslands > 0) {
pfxReleaseLargeTriMesh(gLargeMesh);
}
PfxInt32 ret = pfxCreateLargeTriMesh(gLargeMesh,param);
if(ret != SCE_PFX_OK) {
SCE_PFX_PRINTF("Can't create large mesh.\n");
}
int id = numRigidBodies++;
PfxShape shape;
shape.reset();
shape.setLargeTriMesh(&gLargeMesh);
collidables[id].reset();
collidables[id].addShape(shape);
collidables[id].finish();
bodies[id].reset();
states[id].reset();
states[id].setPosition(PfxVector3(0.0f,-5.0f,0.0f));
states[id].setOrientation(PfxQuat::rotationX(0.5f)*PfxQuat::rotationY(0.7f));
states[id].setMotionType(kPfxMotionTypeFixed);
states[id].setRigidBodyId(id);
}
示例2: createSceneBoxGround
void createSceneBoxGround()
{
int id = numRigidBodies++;
PfxBox box(150.0f,2.5f,150.0f);
PfxShape shape;
shape.reset();
shape.setBox(box);
collidables[id].reset();
collidables[id].addShape(shape);
collidables[id].finish();
bodies[id].reset();
states[id].reset();
states[id].setPosition(PfxVector3(0.0f,-2.5f,0.0f));
states[id].setMotionType(kPfxMotionTypeFixed);
states[id].setRigidBodyId(id);
}
示例3: createBrick
void createBrick(int id,const PfxVector3 &pos,const PfxQuat &rot,const PfxVector3 &boxSize,PfxFloat mass)
{
PfxBox box(boxSize);
PfxShape shape;
shape.reset();
shape.setBox(box);
collidables[id].reset();
collidables[id].addShape(shape);
collidables[id].finish();
bodies[id].reset();
bodies[id].setRestitution(0.0f);
bodies[id].setMass(mass);
bodies[id].setInertia(pfxCalcInertiaBox(boxSize,mass));
states[id].reset();
states[id].setPosition(pos);
states[id].setOrientation(rot);
states[id].setMotionType(kPfxMotionTypeActive);
states[id].setRigidBodyId(id);
}
示例4: createScenePrimitives
void createScenePrimitives()
{
// sphere
{
int id = numRigidBodies++;
PfxSphere sphere(1.0f);
PfxShape shape;
shape.reset();
shape.setSphere(sphere);
collidables[id].reset();
collidables[id].addShape(shape);
collidables[id].finish();
bodies[id].reset();
bodies[id].setMass(1.0f);
bodies[id].setInertia(pfxCalcInertiaSphere(1.0f,1.0f));
states[id].reset();
states[id].setPosition(PfxVector3(-5.0f,5.0f,0.0f));
states[id].setMotionType(kPfxMotionTypeActive);
states[id].setRigidBodyId(id);
}
// box
{
int id = numRigidBodies++;
PfxBox box(1.0f,1.0f,1.0f);
PfxShape shape;
shape.reset();
shape.setBox(box);
collidables[id].reset();
collidables[id].addShape(shape);
collidables[id].finish();
bodies[id].reset();
bodies[id].setMass(1.0f);
bodies[id].setInertia(pfxCalcInertiaBox(PfxVector3(1.0f),1.0f));
states[id].reset();
states[id].setPosition(PfxVector3(0.0f,5.0f,5.0f));
states[id].setMotionType(kPfxMotionTypeActive);
states[id].setRigidBodyId(id);
}
// capsule
{
int id = numRigidBodies++;
PfxCapsule capsule(1.5f,0.5f);
PfxShape shape;
shape.reset();
shape.setCapsule(capsule);
collidables[id].reset();
collidables[id].addShape(shape);
collidables[id].finish();
bodies[id].reset();
bodies[id].setMass(2.0f);
bodies[id].setInertia(pfxCalcInertiaCylinderX(2.0f,0.5f,2.0f));
states[id].reset();
states[id].setPosition(PfxVector3(5.0f,5.0f,0.0f));
states[id].setMotionType(kPfxMotionTypeActive);
states[id].setRigidBodyId(id);
}
// cylinder
{
int id = numRigidBodies++;
PfxCylinder cylinder(0.5f,1.5f);
PfxShape shape;
shape.reset();
shape.setCylinder(cylinder);
collidables[id].reset();
collidables[id].addShape(shape);
collidables[id].finish();
bodies[id].reset();
bodies[id].setMass(3.0f);
bodies[id].setInertia(pfxCalcInertiaCylinderX(0.5f,1.5f,3.0f));
states[id].reset();
states[id].setPosition(PfxVector3(0.0f,10.0f,0.0f));
states[id].setMotionType(kPfxMotionTypeActive);
states[id].setRigidBodyId(id);
}
// convex mesh
{
PfxCreateConvexMeshParam param;
param.verts = BarrelVtx;
param.numVerts = BarrelVtxCount;
param.vertexStrideBytes = sizeof(float)*6;
param.triangles = BarrelIdx;
param.numTriangles = BarrelIdxCount/3;
param.triangleStrideBytes = sizeof(unsigned short)*3;
PfxInt32 ret = pfxCreateConvexMesh(gConvex,param);
if(ret != SCE_PFX_OK) {
SCE_PFX_PRINTF("Can't create gConvex mesh.\n");
}
int id = numRigidBodies++;
PfxShape shape;
shape.reset();
shape.setConvexMesh(&gConvex);
//.........这里部分代码省略.........