MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / addRepXToPxCollection

Method addRepXToPxCollection

physx/samples/samplelargeworld/MeshBuilder.cpp:148–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void MeshBuilder::addRepXToPxCollection(
149 const PxTransform& pose,
150 const PxVec3& scale,
151 PxCollection& collection,
152 const char* name)
153{
154
155 PxRigidStatic* actor = mPhysics.createRigidStatic(pose);
156 PX_ASSERT( actor );
157
158 size_t size = mConvexMeshes.size();
159 PxMeshScale meshScale = PxMeshScale(scale, PxQuat(PxIdentity));
160 for(PxU32 i = 0; i < size; ++i)
161 {
162 PxConvexMesh* mesh = mConvexMeshes[i];
163 PxShape* shape = PxRigidActorExt::createExclusiveShape(*actor, PxConvexMeshGeometry(mesh, meshScale), mMaterial);
164 PX_ASSERT( shape );
165 shape->setFlag(PxShapeFlag::eVISUALIZATION, false);
166 }
167
168 size = mTriMeshes.size();
169 for(PxU32 i = 0; i < size; ++i)
170 {
171 PxTriangleMesh* mesh = mTriMeshes[i];
172 PxShape* shape = PxRigidActorExt::createExclusiveShape(*actor, PxTriangleMeshGeometry(mesh, meshScale), mMaterial);
173 PX_ASSERT( shape );
174 shape->setFlag(PxShapeFlag::eVISUALIZATION, false);
175 }
176
177 if( name )
178 actor->setName(name);
179
180 collection.add(*actor);
181}

Callers 1

addFortressMethod · 0.80

Calls 9

PxMeshScaleClass · 0.50
PxQuatClass · 0.50
createRigidStaticMethod · 0.45
sizeMethod · 0.45
setFlagMethod · 0.45
setNameMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected