Today I try to detect contact with a cone and box
however,when i set worldTransfrom to cone, it doesn't work well.
i try many times,but result in faliure
i wonder where is the Cone's default center and direction?
Could anyone tell me ? Thx in advance.
Where is the default center of ConeShape?
-
- Posts: 18
- Joined: Thu Nov 15, 2007 2:01 pm
- Location: Sichuan province, China
-
- Posts: 861
- Joined: Sun Jul 03, 2005 4:06 pm
- Location: Kirkland, WA
Re: Where is the default center of ConeShape?
I would assume that the default center is the COM which is 1/4 * height. Unfortunately I can't help with the default direction, though this should be very simple to find out. Just step through the cone construction with your favorite debugger.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Where is the default center of ConeShape?
The center of the btConeShape is at the origin, aligned around the Y axis (so the center is at 1/2 height), adopting the VRML standard.
You can also use a btConeShapeX (around X axis) and btConeShapeZ (z-axis).
See Demos\OpenGL\GL_ShapeDrawer.cpp for an example how to render a btConeShape using OpenGL (glutSolidCone).
Hope this helps,
Erwin
*) This is not the center of mass. You can use a btCompoundShape to align the btConeShape to match the center of mass (btRigidBody).
You can also use a btConeShapeX (around X axis) and btConeShapeZ (z-axis).
See Demos\OpenGL\GL_ShapeDrawer.cpp for an example how to render a btConeShape using OpenGL (glutSolidCone).
Hope this helps,
Erwin
*) This is not the center of mass. You can use a btCompoundShape to align the btConeShape to match the center of mass (btRigidBody).