From ae7bec43c45778da5510d79e2c01a14180d711d9 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Wed, 18 May 2016 21:39:11 +0200 Subject: [PATCH] Allow for zero mass rigid body --- src/body/RigidBody.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/body/RigidBody.cpp b/src/body/RigidBody.cpp index 1a54b935..b1818b26 100644 --- a/src/body/RigidBody.cpp +++ b/src/body/RigidBody.cpp @@ -213,8 +213,6 @@ ProxyShape* RigidBody::addCollisionShape(CollisionShape* collisionShape, const Transform& transform, decimal mass) { - assert(mass > decimal(0.0)); - // Create a new proxy collision shape to attach the collision shape to the body ProxyShape* proxyShape = new (mWorld.mMemoryAllocator.allocate( sizeof(ProxyShape))) ProxyShape(this, collisionShape, @@ -348,8 +346,8 @@ void RigidBody::recomputeMassInformation() { mMassInverse = decimal(1.0) / mInitMass; } else { - mInitMass = decimal(1.0); - mMassInverse = decimal(1.0); + mCenterOfMassWorld = mTransform.getPosition(); + return; } // Compute the center of mass