ContactResultCallback::addSingleResult clarification

Post Reply
elojd
Posts: 8
Joined: Sun Feb 14, 2010 8:26 pm

ContactResultCallback::addSingleResult clarification

Post by elojd »

Hello,

I need some clarification about ContactResultCallback::addSingleResult(btManifoldPoint& cp, ...).

1) The easiest first, what is the semantics of the return value (btScalar)? I've noticed that 1.0f or 0 are usually returned.

2) What are cp.m_positionWorldOnA and cp.m_positionWorldOnB?

3) What are cp.m_localPointOnA and cp.m_localPointOnB?

If you could point me to some sketch explaining these values, it will be greatly appreciated. :D
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: ContactResultCallback::addSingleResult clarification

Post by Erwin Coumans »

There was a planned purpose for the return value of addSingleResult, but it is not used so you can ignore it.

The cp.m_positionWorldOnA is the position of the contact point on the surface of object A, same for B, both in world space. cp.m_localPointOnA are the local coordinates of that contact point.

For more details, see my GDC 2010 presentation about contact generation here (slide 14 might help): http://bullet.googlecode.com/files/GDC1 ... ontact.pdf

Thanks,
Erwin
elojd
Posts: 8
Joined: Sun Feb 14, 2010 8:26 pm

Re: ContactResultCallback::addSingleResult clarification

Post by elojd »

Thanks. The presentation did help a lot. :)
jokooon
Posts: 15
Joined: Wed Apr 20, 2011 12:42 pm

Re: ContactResultCallback::addSingleResult clarification

Post by jokooon »

Thanks a lot, I'm glad to have found this.

Although I wonder if this functionnality really requires an abstract callback, for example if I needed a simple raycast, all I needed was to use the default one, which is already implemented.
jokooon
Posts: 15
Joined: Wed Apr 20, 2011 12:42 pm

Re: ContactResultCallback::addSingleResult clarification

Post by jokooon »

I've inherited ContactResultCallback and overriden addsingleresult, but MSVC 10 still tells me my inherited class is abstract, which was not the case in bullet 2.80.
Post Reply