Merge pull request #1 from mhwdvs/fix/collisionBodyColliderTransform

Fix undefined behavior setting Collider transforms on a CollisionBody
This commit is contained in:
matt 2022-08-26 19:41:10 +08:00 committed by GitHub
commit e5af99cd87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,7 +112,7 @@ void Collider::setLocalToBodyTransform(const Transform& transform) {
const Transform& bodyTransform = mBody->mWorld.mTransformComponents.getTransform(mBody->getEntity());
mBody->mWorld.mCollidersComponents.setLocalToWorldTransform(mEntity, bodyTransform * transform);
RigidBody* rigidBody = static_cast<RigidBody*>(mBody);
RigidBody* rigidBody = dynamic_cast<RigidBody*>(mBody);
if (rigidBody != nullptr) {
rigidBody->setIsSleeping(false);
}