1
\$\begingroup\$

I inherited from btCollisionWorld::ContactResultCallback but I really have no idea how to use this virtual function:

btScalar addSingleResult(btManifoldPoint& cp,
        const btCollisionObjectWrapper* colObj0Wrap, int partId0, int index0,
        const btCollisionObjectWrapper* colObj1Wrap, int partId1, int index1)

I thought about using btCollisionWorld::ConvexResultCallback instead but there is no method in btCollisionWorld to use it.

For now my only goal is to move a btCollisionObject around and detect collision with walls, to adjust the position and movement.

I would just need the collision normal, some collision point, or anything else...

\$\endgroup\$
  • \$\begingroup\$ ok so I'm an idiot because everything is in the manifold, it's the only thing I did not check \$\endgroup\$ – djofriend Jan 3 at 15:03
  • 1
    \$\begingroup\$ If you didn't spot it, there's a good chance other users might not spot it either. Want to add an answer explaining what you found and how you solved your problem? I'd be willing to bet it will help out someone in the future. \$\endgroup\$ – DMGregory Jan 4 at 2:25
  • \$\begingroup\$ sure, add to wait a little for it, I'll do it \$\endgroup\$ – djofriend Jan 7 at 8:08
2
\$\begingroup\$

Ok so in

btScalar addSingleResult(btManifoldPoint& cp,
    const btCollisionObjectWrapper* colObj0Wrap, int partId0, int index0,
    const btCollisionObjectWrapper* colObj1Wrap, int partId1, int index1)

btManifoldPoint& cp contains everything I'd need.

https://www.pybullet.org/Bullet/BulletFull/classbtManifoldPoint.html

My native language is not french and I still have quite some trouble understanding the meaning of the word manifold.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.