Which cylinder is the right cylinder?

Post Reply
AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Which cylinder is the right cylinder?

Post by AlexSilverman »

Hello,

I'm gearing up to start using the cylinder shape, and I found that there are 3 different kinds, each with a different major axis. I was wondering if there was ever any preference for one over another, based on the object being simulated. For example, if I'm simulating a coin, do I want a btCylinderShape (major axis = Y), because at rest it will most likely fall so that way? If so, what's the difference between btCylinderShapeX (major axis = X) and btCylinderShapeZ (major axis = Z)?

Thanks.

- Alex
Proctoid
Posts: 18
Joined: Fri Apr 21, 2006 3:04 pm
Location: uk

Re: Which cylinder is the right cylinder?

Post by Proctoid »

I do not believe there is any noticible performance difference with whichever cylinder alignment you choose. I tried them all, rotating each physics shapes start orientation to match with the graphic mesh cylinder creation function that i happened to originally code. The same is for all primitives - it makes no difference (on my pc) - they all work fast regardless of axis alignment. (i did struggle with cones for a while though - they always seemed to point the same way - but i was a while ago and i was implementing huges compound shapes at the time so most likely they are ok and i screwed it up somewhere along the way - i just pick Y aligned in the end and rotated it to match my cone graphics creation function)
AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Re: Which cylinder is the right cylinder?

Post by AlexSilverman »

Ok. Thanks for the clarification. This leads to a question about cylinders that I dealt with when using ODE in a previous project, and I seem to be dealing with again. I believe I saw a forum post about this issue (I can't seem to find it again though), but I'm simulating a coin, and it looks like unless I apply some angular damping, it's unlikely to ever come to rest on either face, or to do so in a reasonable amount of time. Instead it rolls around on its edge, not quite slowing down enough to stop moving, but also not working its way to being upright. As I said, I've applied some angular damping (0.7 if I recall correctly) and it takes care of this, but I was wondering if this behavior was due to trying to simulate that coin shape, and if cylinders are generally better behaved if they're longer, like a length of pipe.

Thanks.

- Alex
Post Reply