Set the local to body transform * @param transform The transform from local-space of the collider into the local-space of the body */
| 104 | * @param transform The transform from local-space of the collider into the local-space of the body |
| 105 | */ |
| 106 | void Collider::setLocalToBodyTransform(const Transform& transform) { |
| 107 | |
| 108 | mBody->mWorld.mCollidersComponents.setLocalToBodyTransform(mEntity, transform); |
| 109 | |
| 110 | // Update the local-to-world transform |
| 111 | const Transform& bodyTransform = mBody->mWorld.mTransformComponents.getTransform(mBody->getEntity()); |
| 112 | mBody->mWorld.mCollidersComponents.setLocalToWorldTransform(mEntity, bodyTransform * transform); |
| 113 | |
| 114 | RigidBody* rigidBody = dynamic_cast<RigidBody*>(mBody); |
| 115 | if (rigidBody != nullptr) { |
| 116 | rigidBody->setIsSleeping(false); |
| 117 | } |
| 118 | |
| 119 | mBody->mWorld.mCollisionDetection.updateCollider(mEntity); |
| 120 | |
| 121 | RP3D_LOG(mBody->mWorld.mConfig.worldName, Logger::Level::Information, Logger::Category::Collider, |
| 122 | "Collider " + std::to_string(getBroadPhaseId()) + ": Set localToBodyTransform=" + |
| 123 | transform.to_string(), __FILE__, __LINE__); |
| 124 | } |
| 125 | |
| 126 | // Return the AABB of the collider in world-space |
| 127 | /** |
nothing calls this directly
no test coverage detected