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

Method setPhysicsShape

physx/samples/samplebase/RenderBaseActor.cpp:174–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174void RenderBaseActor::setPhysicsShape(PxShape* shape, PxRigidActor* actor)
175{
176 mPhysicsShape = shape;
177 mPhysicsActor = actor;
178
179 if(shape)
180 {
181 mCCDWitness = getShapeCenter(actor, shape, mCCDWitnessOffset);
182
183 const PxTransform newPose = PxShapeExt::getGlobalPose(*shape, *actor);
184 setTransform(PxTransform(newPose.p, newPose.q * mPhysicsToGraphicsRot));
185
186 PxRigidActor& ra = *actor;
187 mDynamicActor = ra.is<PxRigidDynamic>();
188 mArticulationLink = ra.is<PxArticulationLink>();
189 mWorldBounds = PxShapeExt::getWorldBounds(*mPhysicsShape, *mPhysicsActor);
190 }
191 else
192 {
193 mDynamicActor = NULL;
194 }
195}
196
197void RenderBaseActor::setRenderMaterial(RenderMaterial* material)
198{

Callers 4

onTickMethod · 0.80
newShapeMethod · 0.80
loadTerrainMethod · 0.80
linkMethod · 0.80

Calls 2

getShapeCenterFunction · 0.70
PxTransformClass · 0.50

Tested by

no test coverage detected