Capsules limited to Z-axis

27 views
Skip to first unread message

Gideon Klompje

unread,
Mar 14, 2011, 12:04:54 PM3/14/11
to ode-...@googlegroups.com
Hi,

I'm working on a piece of code that constructs ragdolls from Panda3D models using some of ODE's primitive shapes.  The algorithm works well when using spheres and boxes, but I'm running into some trouble with capsules due to the fact that Blender/Chicken/Panda3D align bones along the +Y axis, but capsules are limited to the +Z axis.

I'm trying to avoid having to translate each body associated with a capsule shape in my physics simulation's coordinates at every frame for rendering.

I'd be happy to attempt to add variable axis support to the capsule class, but since I have no experience in collision detection, deciphering the algorithms is a bit of a daunting task.  Anyone out there prepared to give me some advice or help me update the capsule class?

Thanks,
Gideon K.


Bram Stolk

unread,
Mar 23, 2011, 1:13:42 PM3/23/11
to ode-users
You do not need to 'translate each body associated with a capsule
shape in my physics simulation's coordinates at every frame for
rendering.'
You can use a fire-and-forget setting with dGeomSetOffsetQuaternion()

dQuaternion q;
dQFromAxisAndAngle( q, 1, 0, 0, 0.5 * M_PI );
dGeomSetOffsetQuaternion( geoms[ i ] , q );

Now, your body in OpenDE and your object in your application have the
same notion of orientation when it comes to the capsule.

Gideon Klompje

unread,
Mar 24, 2011, 5:57:29 AM3/24/11
to ode-...@googlegroups.com
Thanks for the reply.  I read about setting geom offsets some while back, but forgot about them while the wiki was down and I was hacking away in the dark :)

I'll give it a shot...

--
You received this message because you are subscribed to the Google Groups "ode-users" group.
To post to this group, send email to ode-...@googlegroups.com.
To unsubscribe from this group, send email to ode-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ode-users?hl=en.


Reply all
Reply to author
Forward
0 new messages