ChamferCylinder

maxwave

17-04-2006 17:49:33

I don't can create right ChamferCylinder. For it I try this line:

elipsCol=new OgreNewt::CollisionPrimitives::Ellipsoid (m_World,10,100);



But instead ChamferCylinder I see SPHERE and second argument don't influence on result. When changing 3-th parameter, radius of sphere changing and more nothing. I thing it is bug of OgreNewt. :(

walaber

17-04-2006 17:58:01

by the way in your code there, you are creating an Ellipsoid...

the way the chamfer cylinder works is that the "thickness" of the object is determined by the radius (3rd parameter). the height (radius of the wheel) is the 2nd parameter.

so, if the height is less than the radius, you end up with a sphere.

try it like this and look at the shape:
elipsCol=new OgreNewt::CollisionPrimitives::ChamferCylinder(m_World,10.0f,7.0f);

praetor

17-04-2006 18:05:16

Any kind of cylinder basically means it is a tube. An ellipsoid (what you are creating in your code) is more like a generic circular (elongated on one axis) object. So, the ellipsoid will have a curved surface all around, instead of appearing to have a straight surface on its "sides" when viewed from the side.


** **
* * * *
* * * *
* * * *
* * * *
* * * *
* * * *
** **
vs.


Well... I hope that helps. Looking at that... maybe it'll just be more confusing.

maxwave

17-04-2006 19:44:31

Oh, sorry, I have copied not that a line from my code. I typing this:
chCylCol=new OgreNewt::CollisionPrimitives::ChamferCylinder (m_World,5.0f,20.0f);

I get sphere collision instead cylinder.

maxwave

17-04-2006 20:11:08

I try change values to get right result, but I always get "sphere" (if radius<height) or "ellipsoid" (if radius>height). When I increase height, sphere increase too. Whats happening?

praetor

17-04-2006 21:13:17

Yeah for the code you gave it would be a sphere. The second argument must be bigger than the third. If you've tried that and it still is looking eliptical then youve stumped me.

maxwave

18-04-2006 19:12:09

when I try this:

1) chCylCol=new OgreNewt::CollisionPrimitives::ChamferCylinder (m_World,50.0f,10.0f);3

I get this:

when I try this:

2) chCylCol=new OgreNewt::CollisionPrimitives::ChamferCylinder (m_World,10.0f,50.0f);

I get this:

walaber

19-04-2006 00:37:47

that is exactly right. A ChamferCylinder is basically a filled donut, so the "height" must be bigger than the radius.

for a "tube" shape, you would use a "Capsule" instead.