public static void dGeomCapsuleGetParams (DCapsule ccylinder, RefDouble radius, RefDouble length) { radius.d = ccylinder.getRadius(); length.d = ccylinder.getLength(); } //ODE_API
public static void dGeomCapsuleGetParams (DCapsule ccylinder, RefDouble radius, RefDouble length) { radius.d = ccylinder.getRadius(); length.d = ccylinder.getLength(); } //ODE_API
private double getArea(DCapsule geom) { double radius = geom.getRadius(); return 4 * Math.PI * radius * radius + 2 * Math.PI * radius * geom.getLength(); }
private double getVolume(DCapsule geom) { double radius = geom.getRadius(); return Math.PI * radius * radius * geom.getLength() + 4 * Math.PI / 3 * radius * radius * radius; }
private Buoy[] generateBuoys(int bn, DCapsule geom) { double length = geom.getLength(); double radius = geom.getRadius(); Buoy[] buoys = new Buoy[bn]; int i = 0; for (int bz = 0; bz < bn; bz++) { float pz = (float) (((float) bz / (bn - 1) - 0.5) * length); buoys[i++] = new Buoy(0, 0, pz, (float) radius, 1); } return buoys; }
private void drawGeom(DGeom g) { //int gclass = dGeomGetClass(g); if (g instanceof DCapsule) { DVector3C pos = g.getPosition(); DMatrix3C rot = g.getRotation(); DCapsule cap = (DCapsule) g; dsDrawCapsule (pos, rot, cap.getLength(), cap.getRadius()); } }
private void drawGeom(DGeom g) { //int gclass = dGeomGetClass(g); if (g instanceof DCapsule) { DVector3C pos = g.getPosition(); DMatrix3C rot = g.getRotation(); DCapsule cap = (DCapsule) g; dsDrawCapsule (pos, rot, cap.getLength(), cap.getRadius()); } }
dsDrawCapsule (pos, R, cap.getLength(), cap.getRadius());
private void drawGeom (DGeom g, DVector3C pos, DMatrix3C R) { if (g==null) return; if (pos==null) pos = g.getPosition (); if (R==null) R = g.getRotation (); if (g instanceof DBox) { DVector3C sides = ((DBox)g).getLengths(); dsDrawBox (pos,R,sides); } else if (g instanceof DSphere) { dsDrawSphere( pos,R, ((DSphere)g).getRadius() ); } else if (g instanceof DCapsule) { DCapsule c = (DCapsule) g; dsDrawCapsule( pos, R, c.getLength(), c.getRadius() ); } else if (g instanceof DCylinder) { DCylinder c = (DCylinder) g; dsDrawCylinder (pos, R, c.getLength(), c.getRadius()); } else if (g instanceof DConvex) { //dVector3 sides={0.50,0.50,0.50}; dsDrawConvex(pos,R,ConvexCubeGeom.planes, ConvexCubeGeom.planecount, ConvexCubeGeom.points, ConvexCubeGeom.pointcount, ConvexCubeGeom.polygons); } }
dsDrawCapsule (pos,R,cap.getLength(), cap.getRadius());
} else if (g instanceof DCapsule) { DCapsule c = (DCapsule) g; dsDrawCapsule( pos, R, c.getLength(), c.getRadius() ); } else if (g instanceof DCylinder) { DCylinder c = (DCylinder) g;
double length = ((DCapsule)g).getLength(); dsDrawCapsule( pos,R,length,radius );
dsDrawCapsule (pos,R, cap.getLength(), cap.getRadius());
dsDrawCapsule (pos, rot, cap.getLength(), cap.getRadius());
dsDrawCapsule (pos,R,cap.getLength(),cap.getRadius());
dsDrawCapsule (pos, R, cap.getLength(), cap.getRadius());
dsDrawCapsule (pos, R, cap.getLength(), cap.getRadius());
dsDrawCapsule (pos,R,cap.getLength(),cap.getRadius());
} else if (g instanceof DCapsule) { DCapsule cap = (DCapsule) g; dsDrawCapsule (pos,R,cap.getLength(),cap.getRadius()); } else if (g instanceof DConvex) {
dsSetColorAlpha (0f,1f,0f,0.8f); double radius = ((DCapsule)g).getRadius(); double length = ((DCapsule)g).getLength(); dsDrawCapsule (pos,g.getRotation(),length,radius); break;