Sphere vs Mesh

Post Reply
thekiwimaddog
Posts: 1
Joined: Sun Nov 04, 2012 6:12 pm

Sphere vs Mesh

Post by thekiwimaddog »

Hi there I'm new to collision detection and are unsure of the correct terms for what I'm trying to do. So I apologise for sounding like a child.

I'm making a game that requires collision detection between a Sphere and a set of Meshes. They will both be moving and I basically want to get the collision point and collision time based on the position and velocity of both the Meshes and the Sphere.

I can't just do a collision check on each frame as the objects are moving fast and could pass through an object between frames.

Looking at some of the examples it all seems very much impressive but very much overkill for what I'm trying to do.

Is this the library for me or not?

I don't need it to calculate the response to the collision just for it to give me the time and point and obviously build some kind of tree for the meshes for optimization.

Does anyone know the technical terms for what I'm after? :D

Can anyone give me a rough idea of what I need ot do to achive this?

Thanks in advance!

David
MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Re: Sphere vs Mesh

Post by MaxDZ8 »

You're looking for some kind of Continuous Collision Detection (CCD).
I know Bullet has some references here and there about a CCD threshold of some sort but I've never personally used it. There's a ready to go demo however (AppCcdPhysicsDemo), and it appears to be doing pretty much what you need.
It appears to be a very robust functionality. So I'd be positive Bullet is right for you.
hehykissool
Posts: 5
Joined: Thu Oct 11, 2012 6:29 am

Re: Sphere vs Mesh

Post by hehykissool »

set your dynamics world as
m_dynamicsWorld->getDispatchInfo().m_useContinuous=true;

also , set your collision object as
body->setCcdMotionThreshold(btScalar);
body->setCcdSweptSphereRadius(btScalar) ;

you will get more information in your CCDPhysicsDemo
Post Reply