@@ -59,9 +59,9 @@ struct dxBox : public dxGeom {
5959};
6060
6161
62- struct dxCCylinder : public dxGeom {
62+ struct dxCapsule : public dxGeom {
6363 dReal radius,lz; // radius, length along z axis
64- dxCCylinder (dSpaceID space, dReal _radius, dReal _length);
64+ dxCapsule (dSpaceID space, dReal _radius, dReal _length);
6565 void computeAABB ();
6666};
6767
@@ -215,17 +215,17 @@ dReal dGeomBoxPointDepth (dGeomID g, dReal x, dReal y, dReal z)
215215// ****************************************************************************
216216// capped cylinder public API
217217
218- dxCCylinder::dxCCylinder (dSpaceID space, dReal _radius, dReal _length) :
218+ dxCapsule::dxCapsule (dSpaceID space, dReal _radius, dReal _length) :
219219 dxGeom (space,1 )
220220{
221221 dAASSERT (_radius > 0 && _length > 0 );
222- type = dCCylinderClass ;
222+ type = dCapsuleClass ;
223223 radius = _radius;
224224 lz = _length;
225225}
226226
227227
228- void dxCCylinder ::computeAABB ()
228+ void dxCapsule ::computeAABB ()
229229{
230230 dReal xrange = dFabs (R[2 ] * lz) * REAL (0.5 ) + radius;
231231 dReal yrange = dFabs (R[6 ] * lz) * REAL (0.5 ) + radius;
@@ -239,36 +239,36 @@ void dxCCylinder::computeAABB()
239239}
240240
241241
242- dGeomID dCreateCCylinder (dSpaceID space, dReal radius, dReal length)
242+ dGeomID dCreateCapsule (dSpaceID space, dReal radius, dReal length)
243243{
244- return new dxCCylinder (space,radius,length);
244+ return new dxCapsule (space,radius,length);
245245}
246246
247247
248- void dGeomCCylinderSetParams (dGeomID g, dReal radius, dReal length)
248+ void dGeomCapsuleSetParams (dGeomID g, dReal radius, dReal length)
249249{
250- dUASSERT (g && g->type == dCCylinderClass ," argument not a ccylinder" );
250+ dUASSERT (g && g->type == dCapsuleClass ," argument not a ccylinder" );
251251 dAASSERT (radius > 0 && length > 0 );
252- dxCCylinder *c = (dxCCylinder *) g;
252+ dxCapsule *c = (dxCapsule *) g;
253253 c->radius = radius;
254254 c->lz = length;
255255 dGeomMoved (g);
256256}
257257
258258
259- void dGeomCCylinderGetParams (dGeomID g, dReal *radius, dReal *length)
259+ void dGeomCapsuleGetParams (dGeomID g, dReal *radius, dReal *length)
260260{
261- dUASSERT (g && g->type == dCCylinderClass ," argument not a ccylinder" );
262- dxCCylinder *c = (dxCCylinder *) g;
261+ dUASSERT (g && g->type == dCapsuleClass ," argument not a ccylinder" );
262+ dxCapsule *c = (dxCapsule *) g;
263263 *radius = c->radius ;
264264 *length = c->lz ;
265265}
266266
267267
268- dReal dGeomCCylinderPointDepth (dGeomID g, dReal x, dReal y, dReal z)
268+ dReal dGeomCapsulePointDepth (dGeomID g, dReal x, dReal y, dReal z)
269269{
270- dUASSERT (g && g->type == dCCylinderClass ," argument not a ccylinder" );
271- dxCCylinder *c = (dxCCylinder *) g;
270+ dUASSERT (g && g->type == dCapsuleClass ," argument not a ccylinder" );
271+ dxCapsule *c = (dxCapsule *) g;
272272 dVector3 a;
273273 a[0 ] = x - c->pos [0 ];
274274 a[1 ] = y - c->pos [1 ];
@@ -1519,13 +1519,13 @@ int dCollideBoxPlane (dxGeom *o1, dxGeom *o2,
15191519}
15201520
15211521
1522- int dCollideCCylinderSphere (dxGeom *o1, dxGeom *o2, int flags,
1522+ int dCollideCapsuleSphere (dxGeom *o1, dxGeom *o2, int flags,
15231523 dContactGeom *contact, int skip)
15241524{
15251525 dIASSERT (skip >= (int )sizeof (dContactGeom));
1526- dIASSERT (o1->type == dCCylinderClass );
1526+ dIASSERT (o1->type == dCapsuleClass );
15271527 dIASSERT (o2->type == dSphereClass);
1528- dxCCylinder *ccyl = (dxCCylinder *) o1;
1528+ dxCapsule *ccyl = (dxCapsule *) o1;
15291529 dxSphere *sphere = (dxSphere*) o2;
15301530
15311531 contact->g1 = o1;
@@ -1549,13 +1549,13 @@ int dCollideCCylinderSphere (dxGeom *o1, dxGeom *o2, int flags,
15491549}
15501550
15511551
1552- int dCollideCCylinderBox (dxGeom *o1, dxGeom *o2, int flags,
1552+ int dCollideCapsuleBox (dxGeom *o1, dxGeom *o2, int flags,
15531553 dContactGeom *contact, int skip)
15541554{
15551555 dIASSERT (skip >= (int )sizeof (dContactGeom));
1556- dIASSERT (o1->type == dCCylinderClass );
1556+ dIASSERT (o1->type == dCapsuleClass );
15571557 dIASSERT (o2->type == dBoxClass);
1558- dxCCylinder *cyl = (dxCCylinder *) o1;
1558+ dxCapsule *cyl = (dxCapsule *) o1;
15591559 dxBox *box = (dxBox*) o2;
15601560
15611561 contact->g1 = o1;
@@ -1586,17 +1586,17 @@ int dCollideCCylinderBox (dxGeom *o1, dxGeom *o2, int flags,
15861586}
15871587
15881588
1589- int dCollideCCylinderCCylinder (dxGeom *o1, dxGeom *o2,
1589+ int dCollideCapsuleCapsule (dxGeom *o1, dxGeom *o2,
15901590 int flags, dContactGeom *contact, int skip)
15911591{
15921592 int i;
15931593 const dReal tolerance = REAL (1e-5 );
15941594
15951595 dIASSERT (skip >= (int )sizeof (dContactGeom));
1596- dIASSERT (o1->type == dCCylinderClass );
1597- dIASSERT (o2->type == dCCylinderClass );
1598- dxCCylinder *cyl1 = (dxCCylinder *) o1;
1599- dxCCylinder *cyl2 = (dxCCylinder *) o2;
1596+ dIASSERT (o1->type == dCapsuleClass );
1597+ dIASSERT (o2->type == dCapsuleClass );
1598+ dxCapsule *cyl1 = (dxCapsule *) o1;
1599+ dxCapsule *cyl2 = (dxCapsule *) o2;
16001600
16011601 contact->g1 = o1;
16021602 contact->g2 = o2;
@@ -1698,13 +1698,13 @@ int dCollideCCylinderCCylinder (dxGeom *o1, dxGeom *o2,
16981698}
16991699
17001700
1701- int dCollideCCylinderPlane (dxGeom *o1, dxGeom *o2, int flags,
1701+ int dCollideCapsulePlane (dxGeom *o1, dxGeom *o2, int flags,
17021702 dContactGeom *contact, int skip)
17031703{
17041704 dIASSERT (skip >= (int )sizeof (dContactGeom));
1705- dIASSERT (o1->type == dCCylinderClass );
1705+ dIASSERT (o1->type == dCapsuleClass );
17061706 dIASSERT (o2->type == dPlaneClass);
1707- dxCCylinder *ccyl = (dxCCylinder *) o1;
1707+ dxCapsule *ccyl = (dxCapsule *) o1;
17081708 dxPlane *plane = (dxPlane*) o2;
17091709
17101710 // collide the deepest capping sphere with the plane
@@ -1905,14 +1905,14 @@ int dCollideRayBox (dxGeom *o1, dxGeom *o2, int flags,
19051905}
19061906
19071907
1908- int dCollideRayCCylinder (dxGeom *o1, dxGeom *o2,
1908+ int dCollideRayCapsule (dxGeom *o1, dxGeom *o2,
19091909 int flags, dContactGeom *contact, int skip)
19101910{
19111911 dIASSERT (skip >= (int )sizeof (dContactGeom));
19121912 dIASSERT (o1->type == dRayClass);
1913- // dIASSERT (o2->type == dCCylinderClass );
1913+ // dIASSERT (o2->type == dCapsuleClass );
19141914 dxRay *ray = (dxRay*) o1;
1915- dxCCylinder *ccyl = (dxCCylinder *) o2;
1915+ dxCapsule *ccyl = (dxCapsule *) o2;
19161916
19171917 contact->g1 = ray;
19181918 contact->g2 = ccyl;
0 commit comments