23 dGeomDestroy(this->_id
);
30 dGeomID
Geom::Id(void)
37 dBodyID
Geom::GetBody(void)
39 return dGeomGetBody(this->_id
);
44 void Geom::SetBody(Body
&body
)
46 dGeomSetBody(this->_id
, body
.Id());
49 //void Geom::SetBody(dBodyID b)
51 // dGeomSetBody(this->_id, b);
56 void Geom::SetPosition(double x
, double y
, double z
)
58 dGeomSetPosition(this->_id
, x
, y
, z
);
63 void Geom::SetRotation(Matrix3 rotation
)
66 temp
[0] = rotation
.m11
;
67 temp
[4] = rotation
.m12
;
68 temp
[8] = rotation
.m13
;
69 temp
[1] = rotation
.m21
;
70 temp
[5] = rotation
.m22
;
71 temp
[9] = rotation
.m23
;
72 temp
[2] = rotation
.m31
;
73 temp
[6] = rotation
.m32
;
74 temp
[10] = rotation
.m33
;
75 dGeomSetRotation(_id
, temp
);
82 if(this->_id
) dGeomDestroy(this->_id
);
88 void Geom::SetData(void *data
)
90 dGeomSetData(this->_id
, data
);
95 void *Geom::GetData(void)
97 return dGeomGetData(this->_id
);
102 Vector3
Geom::GetPosition(void)
106 temp
= dGeomGetPosition(this->_id
);
114 //GetRotation (left handed system=>transpose)
115 Matrix3
Geom::GetRotation(void)
119 temp
= dGeomGetRotation(this->_id
);
120 retVal
.m11
= temp
[0];
121 retVal
.m12
= temp
[4];
122 retVal
.m13
= temp
[8];
123 retVal
.m21
= temp
[1];
124 retVal
.m22
= temp
[5];
125 retVal
.m23
= temp
[9];
126 retVal
.m31
= temp
[2];
127 retVal
.m32
= temp
[6];
128 retVal
.m33
= temp
[10];
134 void Geom::CreateSphere(Space
&space
, double radius
)
136 if(this->_id
) dGeomDestroy(this->_id
);
137 _id
= dCreateSphere(space
.Id(), radius
);
142 void Geom::CreateBox(Space
&space
, double lx
, double ly
, double lz
)
144 if(this->_id
) dGeomDestroy(this->_id
);
145 _id
= dCreateBox(space
.Id(), lx
, ly
, lz
);
150 void Geom::CreatePlane(Space
&space
, double a
, double b
, double c
, double d
)
152 if(this->_id
) dGeomDestroy(this->_id
);
153 _id
= dCreatePlane(space
.Id(), a
, b
, c
, d
);
158 void Geom::CreateCCylinder(Space
&space
, double radius
, double length
)
160 if(this->_id
) dGeomDestroy(this->_id
);
161 _id
= dCreateCCylinder(space
.Id(), radius
, length
);
166 double Geom::SphereGetRadius(void)
168 return dGeomSphereGetRadius(this->_id
);
173 Vector3
Geom::BoxGetLengths(void)
177 dGeomBoxGetLengths(this->_id
, temp
);
186 Vector4
Geom::PlaneGetParams(void)
190 dGeomPlaneGetParams(this->_id
, temp
);
200 void Geom::CCylinderGetParams(double *radius
, double *length
)
202 dGeomCCylinderGetParams(this->_id
, radius
, length
);
207 int Geom::GetClass(void)
209 return dGeomGetClass(this->_id
);