xexuxjy / bullet-xna

Automatically exported from code.google.com/p/bullet-xna
Other
21 stars 5 forks source link

Incorrect debug rendering of AABB for static box shapes by CollisionWorld #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
(Patch is attached)

If a static rigid body with a box shape is moved away from the origin, the AABB 
drawn by CollisionWorld is incorrect. It surrounds both the box in its 
translated position, and the box at the origin.

The problem seems to be in CollisionWorld.DebugDrawWorld, starting with the 
following line:
if(colObj.GetInternalType()==CollisionObjectTypes.CO_RIGID_BODY)

The actual Bullet library uses the following line instead:
if(getDispatchInfo().m_useContinuous && 
colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY && 
!colObj->isStaticOrKinematicObject())
(http://code.google.com/p/bullet/source/browse/trunk/src/BulletCollision/Collisi
onDispatch/btCollisionWorld.cpp)

This causes it to properly ignore GetInterpolationWorldTransform for the static 
rigid body, which seems to be returning the origin even when the box has been 
translated.

Original issue reported on code.google.com by jeff2...@gmail.com on 9 Aug 2012 at 4:37

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks Jeff. Patch added.

Original comment by xexu...@gmail.com on 10 Aug 2012 at 7:42