I'm trying to understand what exactly I'm creating with NewtonCreateChamferCylinder, but I'm struggling. I was hoping I might be able to get a little bit of guidance.
Basically, it isn't completely clear to me from the documentation for this function what the radius and height parameters represent. I was attempting to use the NewtonBodyGetAABB function to help me visualize the chamfer cylinder as follows:
- Code: Select all
QMatrix4x4 baseMatrix;
NewtonCollision* const baseCollision = NewtonCreateChamferCylinder(world, 1, .25, 0, baseMatrix.constData());
QMatrix4x4 myMatrix;
NewtonBody* baseBody = NewtonCreateDynamicBody(world, baseCollision, myMatrix.constData());
QVector3D p0;
QVector3D p1;
NewtonBodyGetAABB(baseBody, &p0[0], &p1[0]);
When I look at the p0 and p1 vectors (the corners of the bounding box), the bounding box for this example is:
-0.1875 < X < 0.1875
-1.1875 < Y < 1.1875
-1.1875 < Z < 1.1875
Those aren't exactly what I was expecting to see. I was expecting that this chamfer cylinder would be bound by one of the following boxes (depending on whether the height parameter the full height or half height):
-0.25 < X < 0.25
-1.25 < Y < 1.25
-1.25 < Z < 1.25
or
-0.125 < X < 0.125
-1.125 < Y < 1.125
-1.125 < Z < 1.125
When I try smaller numbers for the radius and height, such as this...
- Code: Select all
NewtonCollision* baseCollision = NewtonCreateChamferCylinder(world, 0.02, 0.005, 0, baseMatrix.constData());
...the bounding box is even tougher to understand:
-0.065 < X < 0.065
-0.085 < Y < 0.085
-0.085 < Z < 0.085
It seems like maybe I'm confused on something here. Can anyone out there offer any guidance? For reference, below is a 2D image of what I thought the chamfer cylinder looked like. The chamfer cylinder shape would be what you'd get if you revolve the profile 360 degrees about the dotted line. Maybe my sketch is completely wrong! I appreciate whatever help I can get on this, as I'm genuinely confused!
Thanks,
Bill