public static void dGeomCylinderGetParams (DCylinder cylinder, RefDouble radius, RefDouble length) { radius.d = cylinder.getRadius(); length.d = cylinder.getLength(); }
public static void dGeomCylinderGetParams (DCylinder cylinder, RefDouble radius, RefDouble length) { radius.d = cylinder.getRadius(); length.d = cylinder.getLength(); }
private double getArea(DCylinder geom) { double radius = geom.getRadius(); return 2 * Math.PI * radius * radius + 2 * Math.PI * radius * geom.getLength(); }
private double getVolume(DCylinder geom) { double radius = geom.getRadius(); return Math.PI * radius * radius * geom.getLength(); }
private Buoy[] generateBuoys(int bn, DCylinder geom) { double length = geom.getLength(); double radius = geom.getRadius(); double bRadius = Math.min(0.25 * length, 0.5 * radius); int segments = 2; Buoy[] buoys = new Buoy[bn * segments]; int i = 0; for (int bz = 0; bz < segments; bz++) { float pz = (float) (((float) bz / (segments - 1) - 0.5) * (length - bRadius)); for (int bc = 0; bc < bn; bc++) { double a = 2 * Math.PI * bc / bn; float px = (float) ((radius - bRadius) * Math.cos(a)); float py = (float) ((radius - bRadius) * Math.sin(a)); buoys[i++] = new Buoy(px, py, pz, (float) bRadius, 1); } } return buoys; }
private void drawGeom(DGeom g) { DVector3C pos = g.getPosition(); DMatrix3C rot = g.getRotation(); if (g instanceof DCylinder) { DCylinder cyl = (DCylinder) g; if (g == geom1) { dsSetColorAlpha(1, 0, 0, 1); } else { dsSetColorAlpha(0, 1, 0, 1); } dsSetTexture (DS_TEXTURE_NUMBER.DS_WOOD); dsDrawCylinder(pos, rot, cyl.getLength(), cyl.getRadius()); } else { System.exit(0); } }
private void drawGeom (DGeom g) { DVector3C pos = g.getPosition(); DMatrix3C R = g.getRotation(); //int type = dGeomGetClass (g); if (g instanceof DBox) { DVector3C sides = ((DBox)g).getLengths (); dsDrawBox (pos,R,sides); } if (g instanceof DCylinder) { double r = ((DCylinder)g).getRadius(); double l = ((DCylinder)g).getLength(); dsDrawCylinder (pos, R, l, r); } }
dsDrawCylinder (pos, R, cyl.getLength(), cyl.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); } }
dsSetColor(.3f, .3f, 1f); dsDrawBox(kbox.getPosition(), kbox.getRotation(), lengths); double radius = kpole.getRadius(); double length = kpole.getLength(); dsSetTexture(DS_TEXTURE_NUMBER.DS_CHECKERED);
double length, radius; radius = kpole.getRadius(); length = kpole.getLength(); dsSetTexture(DS_TEXTURE_NUMBER.DS_CHECKERED);
dsDrawCylinder (pos,R,c.getLength(),c.getRadius());
dsDrawCylinder (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) {
double radius = ((DCylinder)g).getRadius(); double length = ((DCylinder)g).getLength(); dsDrawCylinder (pos,R,length,radius);
dsDrawCylinder (pos,R,cyl.getLength(),cyl.getRadius());
dsDrawCylinder (pos, R, cyl.getLength(), cyl.getRadius());
dsDrawCylinder (pos, R, cyl.getLength(), cyl.getRadius());
dsDrawCylinder (pos,R,cyl.getLength(),cyl.getRadius());
dsDrawCylinder (pos,R,cyl.getLength(),cyl.getRadius());