From b57314c5900d1b60cefa3448454e3e5b7b3618ff Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Tue, 19 Jan 2010 06:34:39 +0000 Subject: [PATCH] Added write access to implicitShapeDimensions, this allows to change the dimensions of a box, capsule etc. See also request here: http://code.google.com/p/bullet/issues/detail?id=325 Also added a warning. This warning also applies to all methods that change the collision shape: "changing a collision shape while the body is in the world is not recommended, it is best to remove the body from the world, then make the change, and re-add it alternatively flush the contact points, see documentation for 'cleanProxyFromPairs'" --- .../CollisionShapes/btConvexInternalShape.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/BulletCollision/CollisionShapes/btConvexInternalShape.h b/src/BulletCollision/CollisionShapes/btConvexInternalShape.h index 3865d8e4b..58368901b 100644 --- a/src/BulletCollision/CollisionShapes/btConvexInternalShape.h +++ b/src/BulletCollision/CollisionShapes/btConvexInternalShape.h @@ -52,6 +52,15 @@ public: return m_implicitShapeDimensions; } + ///warning: use setImplicitShapeDimensions with care + ///changing a collision shape while the body is in the world is not recommended, + ///it is best to remove the body from the world, then make the change, and re-add it + ///alternatively flush the contact points, see documentation for 'cleanProxyFromPairs' + void setImplicitShapeDimensions(const btVector3& dimensions) + { + m_implicitShapeDimensions = dimensions; + } + ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const {