MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / setGlobalPose

Method setGlobalPose

deps/physx/physx/source/physx/src/NpRigidDynamic.cpp:78–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77
78void NpRigidDynamic::setGlobalPose(const PxTransform& pose, bool autowake)
79{
80 NpScene* scene = NpActor::getAPIScene(*this);
81
82#if PX_CHECKED
83 if(scene)
84 scene->checkPositionSanity(*this, pose, "PxRigidDynamic::setGlobalPose");
85#endif
86
87 PX_CHECK_AND_RETURN(pose.isSane(), "PxRigidDynamic::setGlobalPose: pose is not valid.");
88 NP_WRITE_CHECK(NpActor::getOwnerScene(*this));
89
90 const PxTransform newPose = pose.getNormalized(); //AM: added to fix 1461 where users read and write orientations for no reason.
91
92 Scb::Body& b = getScbBodyFast();
93 const PxTransform body2World = newPose * b.getBody2Actor();
94 b.setBody2World(body2World, false);
95
96 if(scene)
97 updateDynamicSceneQueryShapes(mShapeManager, scene->getSceneQueryManagerFast(), *this);
98
99 // invalidate the pruning structure if the actor bounds changed
100 if(mShapeManager.getPruningStructure())
101 {
102 Ps::getFoundation().error(PxErrorCode::eINVALID_OPERATION, __FILE__, __LINE__, "PxRigidDynamic::setGlobalPose: Actor is part of a pruning structure, pruning structure is now invalid!");
103 mShapeManager.getPruningStructure()->invalidate(this);
104 }
105
106 if(scene && autowake && !(b.getActorFlags() & PxActorFlag::eDISABLE_SIMULATION))
107 wakeUpInternal();
108}
109
110
111PX_FORCE_INLINE void NpRigidDynamic::setKinematicTargetInternal(const PxTransform& targetPose)

Callers

nothing calls this directly

Calls 8

checkPositionSanityMethod · 0.80
isSaneMethod · 0.45
getNormalizedMethod · 0.45
setBody2WorldMethod · 0.45
errorMethod · 0.45
invalidateMethod · 0.45
getActorFlagsMethod · 0.45

Tested by

no test coverage detected