btkinematiccharactercontroller capsule offset

Alundra
Posts: 14
Joined: Sat Aug 13, 2011 3:25 pm

btkinematiccharactercontroller capsule offset

Post by Alundra »

Hi all,
using btkinematiccharactercontroller you need to set to it a btConvexShape but I need an offset on the capsule to have it good.
The offset needs to be the half of the height on the y, because my character mesh has foot at 0.
There is a way to achieve that ?
Thanks
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: btkinematiccharactercontroller capsule offset

Post by Flix »

A btConvexHullShape or a btMultiSphereShape can be created with an offset (center!=(0,0,0)).

The btMultiSphereShape can build any kind of capsules (even with bottom radius!= top radius), by using two vertically spaced points and two radii (and additionally it can "skew" the capsule with its local scaling).

I suggest you start with a simple btMultiSphereShape with 2 vertical points (centered in your new center of mass) and the same radius.

P.S. Be warned that libOpenGLSupport might not display the shape as it really is.