Page 1 of 1

what does the third parameter in btCylinderShape mean?

Posted: Tue Oct 19, 2010 6:43 am
by freikorps
In the API reference, it is says that all the parameters are half extents, but due to my test, the first is the width and the second is the radius, but I still don't know what the third parameter means, does anyone know how can I find out the exact meaning of each parameter of the functions in bullet engine?

thanks

Re: what does the third parameter in btCylinderShape mean?

Posted: Tue Oct 19, 2010 11:04 pm
by mi076
AFAIK, btCylinderShape is Y axis aligned, so the halfExtends[1] is length/2 and radius is halfExtends[0] and halfExtends[2]. (Should have the same value). Correct me please if it is wrong :-/

Re: what does the third parameter in btCylinderShape mean?

Posted: Wed Oct 20, 2010 2:16 am
by freikorps
But when I set the two radius with different number, the cylinder still has a round shape but eclipse, and when the third parameter is set to be very large, the cylinder is acting very hard to move, and when it is below zero, the cylinder can go through the floor, :? do I have to read the resource code to know the meanings of the parameters? because I can't find everything I need in the API reference.

thanks

Re: what does the third parameter in btCylinderShape mean?

Posted: Mon Nov 19, 2018 3:56 am
by bram
The half extends contain three values, two of which is the radius, and the third is half the height of the cylinder.

Which value goes where, depends on which class you use.
E.g. btCylinderShapeZ has its axis in Z, so you would construct it as:

Code: Select all

wheelshape = new btCylinderShapeZ( btVector3( radius, radius, height/2 );