[ODE] adding direction parameter to CCylinder geom?
Doron Tal
dtal at email.arc.nasa.gov
Wed Dec 28 14:42:22 MST 2005
Yeah, that's what I was thinking too. But if you want a C
or C++ interface to pre-rotated cylinders that's easy: just
declare the struct as you did below, with the direction parameter,
and then have two constructors in it: one without the direction
parameter, which will just be a replica of the old constructor,
and one with the direction parameter, which rotates the geom
and calls the old constructor -- very little code to add and
this one should work.
-doron
Rodrigo Hernandez wrote:
> I dont quite understand whats the purpose of having a direction in the
> way you descrived, if that means the cylinder width begins lying on
> either the X Y or Z axe, you can get the exact same results by rotating
> the geom 90 degrees on either X,Y or Z before you start the simulation,
> no need wto write any code inside ODE.
>
> Cheers!
>
> Graham Fyffe wrote:
>
>
>>Hi everyone! I am playing with adding a specified direction to the
>>CCylinder geom. I started by changing the struct from this:
>>
>>struct dxCCylinder : public dxGeom {
>> dReal radius,lz; // radius, length along z axis
>> dxCCylinder (dSpaceID space, dReal _radius, dReal _length);
>> void computeAABB();
>>};
>>
>>to this:
>>
>>struct dxCCylinder : public dxGeom {
>> int direction; // 1 = x, 2 = y, 3 = z
>> dReal radius,ld; // radius, length along direction axis
>> dxCCylinder (dSpaceID space, int _direction, dReal _radius, dReal _length);
>> void computeAABB();
>>};
>>
>>and then I made 36 more changes to collision_std.cpp and 5 changes to
>>collision_trimesh_ccylinder.
>>
>>Anyhow, it doesn't quite work. Even trying to roll a ccylinder along
>>a simple plane geom looks all wonky if I use any axis other than Z. I
>>probably missed some changes in the zillions of hard coded matrix
>>indeces inside collision_std.cpp.
>>
>>My question is, has anyone else ever made a patch like this? I mean,
>>one that works? :)
>>
>>- Graham
>>
>>_______________________________________________
>>ODE mailing list
>>ODE at q12.org
>>http://q12.org/mailman/listinfo/ode
>>
>>
>>
>
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
More information about the ODE
mailing list