iamcsharper / bullet-xna

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

ClosestPointInput.m_maximumDistanceSquared not initialized in some places #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Patch is attached.

In the original bullet library, the constructor of 
btDiscreteCollisionDetectorInterface::ClosestPointInput initializes 
m_maximumDistanceSquared to BT_LARGE_FLOAT, which is defined as 1e18f. (See 
BulletCollision\NarrowPhaseCollision\btDiscreteCollisionDetectorInterface.h)

bullet-xna does not initialize it in the constructor, but instead initializes 
it in a number of places where ClosestPointInput is used (to float.MaxValue).

ContinuousConvexCollision.ComputeClosestPoints() is not one of these places. 
This causes CollisionWorld.ConvexSweepTest() to not detect collisions in some 
cases where collisions should be detected. The attached patch adds the missing 
initialization.

(GjkConvexCast.CalcTimeOfImpact() might have the same problem, but I'm not sure)

Original issue reported on code.google.com by jeff2...@gmail.com on 28 Feb 2013 at 1:17

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Jeff,

Thanks for the bug report. Not completely sure which version you're using but 
the latest code should have fixes for this as part of a load of memory usage 
and performance changes.  The function now looks like :

                ClosestPointInput input = ClosestPointInput.Default();
                input.m_transformA = transA;
                input.m_transformB = transB;

as ClosestPointInput is a struct, and that should set the 'correct' initial 
values for the object.

Thanks,

Mark

Original comment by xexu...@gmail.com on 28 Feb 2013 at 10:57

GoogleCodeExporter commented 9 years ago
Heh, sorry about that, I was on an older version. Everything is working great 
on the newest version.

Thanks,
Jeff

Original comment by jeff2...@gmail.com on 2 Mar 2013 at 12:21

GoogleCodeExporter commented 9 years ago
fixed in current version

Original comment by xexu...@gmail.com on 2 Mar 2013 at 7:52