| 76 | |
| 77 | |
| 78 | void 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 | |
| 111 | PX_FORCE_INLINE void NpRigidDynamic::setKinematicTargetInternal(const PxTransform& targetPose) |
nothing calls this directly
no test coverage detected