MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / setLocalToBodyTransform

Method setLocalToBodyTransform

src/collision/Collider.cpp:106–124  ·  view source on GitHub ↗

Set the local to body transform * @param transform The transform from local-space of the collider into the local-space of the body */

Source from the content-addressed store, hash-verified

104 * @param transform The transform from local-space of the collider into the local-space of the body
105 */
106void 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/**

Callers

nothing calls this directly

Calls 5

getEntityMethod · 0.45
setIsSleepingMethod · 0.45
updateColliderMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected