[ODE] ccylinder
Anders Olofsson
anders.olofsson at biologigrand.ac
Mon Apr 19 14:37:41 MST 2004
Try setting the direction to 1,2 or 3 in the setmass function call..
this works for me:
dReal cylRadius = 1.0f, Radius, Length;
dMass mCyl;
dBodyID myCylBody;
dGeomID myCylGeom;
dMassSetCappedCylinder ( &mCyl, 1.0f , 1, cylRadius, 8.0); //Check your
direction
myCylBody = dBodyCreate( world );
myCylGeom = dCreateCCylinder ( space, cylRadius, 8.0);
dBodySetMass(myCylBody, &mCyl);
dGeomSetBody(myCylGeom, myCylBody);
dBodySetPosition( myCylBody, 20.0, 20.0, 8.0 );
dGeomCCylinderGetParams (myCylGeom, &Radius, &Length);
Cheers
At 14:01 2004-04-19 +0200, you wrote:
>Hi, I'm trying to draw a capped Cylinder and then to get its parameters
>but I just can't use the instruction dGeomCCylinderGetParams without
>having an error at execution. Anybody got an idea?
>Here is the code in the init function. sRadius and sLength are 2 pointers
>to a dReal.
>
> dMassSetCappedCylinder ( &mCyl, DENSITY, 0, cylRadius, 8.0);
More information about the ODE
mailing list