/** * Get the side lengths of a box. * * @param box the box to query * @param result the returned side lengths * * @see #dGeomBoxSetLengths(DBox, double, double, double) */ //ODE_API public static void dGeomBoxGetLengths (DBox box, DVector3 result) { box.getLengths(result); }
/** * Get the side lengths of a box. * * @param box the box to query * @param result the returned side lengths * * @see #dGeomBoxSetLengths(DBox, double, double, double) */ //ODE_API public static void dGeomBoxGetLengths (DBox box, DVector3 result) { box.getLengths(result); }
private double getVolume(DBox geom) { DVector3C lengths = geom.getLengths(); return lengths.get0() * lengths.get1() * lengths.get2(); }
private void drawBox (DBox id, int R, int G, int B) { if (id==null) return; DVector3C pos = id.getPosition (); DMatrix3C rot = id.getRotation (); dsSetColor (R,G,B); dsDrawBox (pos, rot, id.getLengths()); }
private static void drawBox (DBox id, int R, int G, int B) { if (id==null) return; DVector3C pos = id.getPosition(); DMatrix3C rot = id.getRotation(); dsSetColor (R,G,B); DVector3C l = id.getLengths(); dsDrawBox (pos, rot, l); }
void draw() //const { DVector3 lengths = new DVector3(); geom.getLengths(lengths); dsSetTexture(DS_TEXTURE_NUMBER.DS_WOOD); dsSetColor(0,1,0); dsDrawBox(geom.getPosition(), geom.getRotation(), lengths); } public void DESTRUCTOR() {
void draw() //const { DVector3 lengths = new DVector3(); geom.getLengths(lengths); dsSetTexture(DS_TEXTURE_NUMBER.DS_WOOD); dsSetColor(0,1,0); dsDrawBox(geom.getPosition(), geom.getRotation(), lengths); } public void DESTRUCTOR() {
private double getArea(DBox geom) { DVector3C lengths = geom.getLengths(); return lengths.get0() * lengths.get1() + lengths.get0() * lengths.get2() + lengths.get2() * lengths.get1(); }
private static void simLoop (boolean pause) { if (!pause) { OdeHelper.spaceCollide(space,null,nearCallback); world.quickStep (0.05); contactgroup.empty (); } DVector3C sides1 = geom[0].getLengths(); DVector3C sides2 = geom[1].getLengths(); dsSetTexture (DS_TEXTURE_NUMBER.DS_WOOD); dsSetColor (1,1,0); dsDrawBox (body[0].getPosition(), body[0].getRotation(), sides1); dsSetColor (0,1,1); dsDrawBox (body[1].getPosition(), body[1].getRotation(), sides2); }
private void drawGeom(DGeom g) { DVector3C pos = g.getPosition(); DMatrix3C rot = g.getRotation(); if (g instanceof DBox) { if (applyForce) { dsSetColor(1., .5, 0.); } else { dsSetColor(1, 1, 0); } dsSetTexture (DS_TEXTURE_NUMBER.DS_WOOD); DVector3C lengths = ((DBox)g).getLengths(); dsDrawBox(pos, rot, lengths); } }
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); } }
private Buoy[] generateBuoys(int bn, DBox geom) { DVector3C lengths = geom.getLengths(); double lx = lengths.get0(); double ly = lengths.get1(); double lz = lengths.get2(); double d = 0.30; double radius = Math.min(Math.min(lx, ly), lz) * 0.25; double weight = 1; double radius2 = Math.min(Math.min(lx, ly), lz) * 0.25; double weight2 = 0.1; Buoy[] buoys = new Buoy[14]; double d2 = 0.25; buoys[0] = new Buoy(-d * lx, 0, 0, radius, weight); buoys[1] = new Buoy(d * lx, 0, 0, radius, weight); buoys[2] = new Buoy(0, -d * ly, 0, radius, weight); buoys[3] = new Buoy(0, d * ly, 0, radius, weight); buoys[4] = new Buoy(0, 0, -d * lz, radius, weight); buoys[5] = new Buoy(0, 0, d * lz, radius, weight); buoys[6] = new Buoy(-lx * d2, -ly * d2, -lz * d2, radius2, weight2); buoys[7] = new Buoy(-lx * d2, -ly * d2, lz * d2, radius2, weight2); buoys[8] = new Buoy(-lx * d2, ly * d2, -lz * d2, radius2, weight2); buoys[9] = new Buoy(-lx * d2, ly * d2, lz * d2, radius2, weight2); buoys[10] = new Buoy(lx * d2, -ly * d2, -lz * d2, radius2, weight2); buoys[11] = new Buoy(lx * d2, -ly * d2, lz * d2, radius2, weight2); buoys[12] = new Buoy(lx * d2, ly * d2, -lz * d2, radius2, weight2); buoys[13] = new Buoy(lx * d2, ly * d2, lz * d2, radius2, weight2); return buoys; }
private void drawGeom(DGeom g) { //int gclass = dGeomGetClass(g); DVector3C pos = g.getPosition(); DMatrix3C rot = g.getRotation(); if (g instanceof DSphere) { dsSetColorAlpha(0, 0.75, 0.5, 1); dsSetTexture (DS_TEXTURE_NUMBER.DS_CHECKERED); dsDrawSphere(pos, rot, ((DSphere)g).getRadius()); } else if (g instanceof DBox) { dsSetColorAlpha(1, 1, 0, 1); dsSetTexture (DS_TEXTURE_NUMBER.DS_WOOD); DVector3C lengths = ((DBox)g).getLengths(); dsDrawBox(pos, rot, lengths); } }
private void drawGeom(DGeom g) { //int gclass = dGeomGetClass(g); DVector3C pos = g.getPosition(); DMatrix3C rot = g.getRotation(); if (g instanceof DSphere) { dsSetColorAlpha(0, 0.75, 0.5, 1); dsSetTexture (DS_TEXTURE_NUMBER.DS_CHECKERED); dsDrawSphere(pos, rot, ((DSphere)g).getRadius()); } else if (g instanceof DBox) { dsSetColorAlpha(1, 1, 0, 1); dsSetTexture (DS_TEXTURE_NUMBER.DS_WOOD); DVector3C lengths = ((DBox)g).getLengths(); dsDrawBox(pos, rot, lengths); } }
@Override public void step (boolean pause) { if (!pause) { space.collide (null, nearCallback); world.step (0.017); // 60 fps // remove all contact joints contactgroup.empty(); } // Render ramps and spheres dsSetTexture (DS_TEXTURE_NUMBER.DS_WOOD); dsSetColor (1,0.5,0); for (DBox g: rampGeom) { dsDrawBox (g.getPosition(), g.getRotation(), g.getLengths()); } dsSetColor(0,0,1); for (DSphere g: sphereGeom) { dsDrawSphere (g.getPosition(), g.getRotation(), sphereRadius); } }
kbox.getLengths(lengths); dsSetTexture(DS_TEXTURE_NUMBER.DS_WOOD); dsSetColor(.3f, .3f, 1f); matraca_geom.getLengths(lengths); dsSetColor(1,0,0); dsSetTexture(DS_TEXTURE_NUMBER.DS_WOOD);
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); } }
DVector3C sides = ((DBox)g).getLengths(); dsDrawBox (pos,R,sides);
DVector3C sides = ((DBox)g).getLengths(); dsDrawBox (pos,R,sides);
body[i].getRotation(),0.02f,RADIUS); DVector3C ss = ground_box.getLengths(); dsDrawBox (ground_box.getPosition(), ground_box.getRotation(), ss);