From 8c9bb7be1fe2bbfdd160ea9a98fba5530d8a77f3 Mon Sep 17 00:00:00 2001 From: enn0x Date: Mon, 22 Aug 2011 22:03:50 +0000 Subject: [PATCH] Enforce update of inertia tensor after shape or mass changes. --- panda/src/bullet/bulletRigidBodyNode.cxx | 1 + panda/src/bullet/bulletSphericalConstraint.h | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/panda/src/bullet/bulletRigidBodyNode.cxx b/panda/src/bullet/bulletRigidBodyNode.cxx index 8ff2e909b3..b76f6b9dcd 100644 --- a/panda/src/bullet/bulletRigidBodyNode.cxx +++ b/panda/src/bullet/bulletRigidBodyNode.cxx @@ -104,6 +104,7 @@ set_mass(float mass) { } _rigid->setMassProps(mass, inertia); + _rigid->updateInertiaTensor(); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/bullet/bulletSphericalConstraint.h b/panda/src/bullet/bulletSphericalConstraint.h index 8b6b68afda..3b4efe1d30 100644 --- a/panda/src/bullet/bulletSphericalConstraint.h +++ b/panda/src/bullet/bulletSphericalConstraint.h @@ -27,7 +27,13 @@ class BulletRigidBodyNode; //////////////////////////////////////////////////////////////////// // Class : BulletSphericalConstraint -// Description : +// Description : A constraint between two rigid bodies, each with a +// pivot point. The pivot points are described in the +// body's local space. The constraint limits movement +// of the two rigid bodies in such a way that the +// pivot points match in global space. The spherical +// constraint can be seen as a "ball and socket" +// joint. //////////////////////////////////////////////////////////////////// class EXPCL_PANDABULLET BulletSphericalConstraint : public BulletConstraint {