Cone collision shape query

Post Reply
Proctoid
Posts: 18
Joined: Fri Apr 21, 2006 3:04 pm
Location: uk

Cone collision shape query

Post by Proctoid »

Hi Guys, my first post... sorry in advance for my non technical scribble ;-)

Nice physics, I dropped your wall of cubes demo into a d3d demo app and everything works fine - thank you ;-)

I have changed the cubes to cones, but as the wall of cones collapses and settles on the floor they appear incorrect...

I can get two effects depending on how i orientate my graphic model.

1. The cones at rest look as if their base centre is the centre of mass and that the floor is made of jelly that it half sinks into with the tip pointing up at an angle. When i use rayTest() on the scene i can see that the returned hitobjs meshes match what i see on screen.

2. If I flip my model 180 (swap tip and base), the cones act exactly as solid cones on a solid floor should react. ie. at rest the tip is on the floor and the base centre is around the radius size up off the floor (you know what i mean). But now, rayTest() of the scene returns each cone with meshes with reversed tip and base. ie. you think you are clicking the circular base of a cone onscreen but you are actually clicking above the tip and missing the hitobj as far as the physics mesh is concerned.
(Cubes work fine - i can click any part of them to push them around the scene)

Can anyone tell me which is correct or give me a hint of what source file i should investigate further to find what's going on in the cones mesh?

Or is this a bug ?

Again, great physics - well done all.

thanks
PP
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Cone collision shape query

Post by Erwin Coumans »

Proctoid wrote: Can anyone tell me which is correct or give me a hint of what source file i should investigate further to find what's going on in the cones mesh?
Or is this a bug ?
It is a bug, related to raycasting. It should be fixed in latest CVS version.
Raycasting uses the general continuous collision detection implementations. The SubsimplexConvexCast, GjkConvexCast or ContinuousConvexCollision. The SubsimplexConvexCast has a sign issue, due to Minkowski space. So either use the ContinuousConvexCollision, or get the fix from CVS.

http://www.continuousphysics.com/Bullet ... tml#l01251

Erwin
Post Reply