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() {
@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); } }
dsSetTexture(DS_TEXTURE_NUMBER.DS_WOOD); dsSetColor(.3f, .3f, 1f); dsDrawBox(kbox.getPosition(), kbox.getRotation(), lengths); double radius = kpole.getRadius(); double length = kpole.getLength(); dsSetColor(1,0,0); dsSetTexture(DS_TEXTURE_NUMBER.DS_WOOD); dsDrawBox(matraca_geom.getPosition(), matraca_geom.getRotation(), lengths);
dsSetTexture(DS_TEXTURE_NUMBER.DS_WOOD); dsSetColor(.3f, .3f, 1f); dsDrawBox(kbox.getPosition(), kbox.getRotation(), lengths); double length, radius; dsSetColor(1,0,0); dsSetTexture(DS_TEXTURE_NUMBER.DS_WOOD); dsDrawBox(matraca_geom.getPosition(), matraca_geom.getRotation(), lengths);
DMatrix3C rotBox2 = box2.getRotation(); dsSetColor (1,1,0); ss = box2.getLengths(); DMatrix3C rotBox1 = box1.getRotation(); dsSetColor (1,1,2); ss = box1.getLengths();
i = dRandInt (3); if (dRandReal() > 0.5) q.set( i, 0.5*s.get(i) ); else q.set( i, -0.5*s.get(i) ); dMultiply0 (q2,box.getRotation(),q); if (dRandReal() > 0.5) q.scale (i, -1); dMultiply0 (q2,box.getRotation(),q); q2.add(p); if (box.getPointDepth (q2) >= 0) if (testFAILED()) return false; dMultiply0 (q2,box.getRotation(),q); q2.add(p); if (box.getPointDepth (q2) <= 0) if (testFAILED()) return false; q.set(i, s.get(i)*0.5 - d ); if (dRandReal() > 0.5) q.scale( i, -1 ); dMultiply0 (q2,box.getRotation(),q); q2.add(p); if (dFabs(box.getPointDepth (q2) - d) >= tol) if (testFAILED()) return false;
dsDrawBox (ground_box.getPosition(), ground_box.getRotation(), ss);
i = dRandInt (3); if (dRandReal() > 0.5) q.set(i, 0.99*0.5*s.get(i) ); else q.set(i, -0.99*0.5*s.get(i) ); dMultiply0 (q2,box.getRotation(),q); q2.add(p); ray.setPosition (q2); i = dRandInt (3); if (dRandReal() > 0.5) q.set(i, 1.01*0.5*s.get(i)); else q.set(i, -1.01*0.5*s.get(i)); dMultiply0 (q2,box.getRotation(),q); q2.add( p ); ray.setPosition (q2); dMultiply0 (q2,box.getRotation(),q); q2.add( p ); for (j=0; j<3; j++) q3.set(j, (dRandReal()-0.5)*0.99*s.get(j) ); dMultiply0 (q4,box.getRotation(),q3); q4.add( p ); n.eqDiff( q4, q2 ); i = dRandInt (3); if (dRandReal() > 0.5) q.set(i, 1.01*0.5*s.get(i)); else q.set(i, -1.01*0.5*s.get(i)); dMultiply0 (q2,box.getRotation(),q); q3.eqSum( q2, p ); q2.normalize(); i = dRandInt (3); if (dRandReal() > 0.5) q.set(i, 1.01*0.5*s.get(i)); else q.set(i, -1.01*0.5*s.get(i) ); dMultiply0 (q2,box.getRotation(),q); q3.eqSum( p, q2, 2 );
DVector3 ss = new DVector3(); wall_boxes[i].getLengths (ss); dsDrawBox(wall_boxes[i].getPosition(), wall_boxes[i].getRotation(), ss); DVector3 ss = new DVector3(); wall_boxes[i].getLengths (ss); dsDrawBox(wall_boxes[i].getPosition(), wall_boxes[i].getRotation(), ss); DVector3 sides = new DVector3(LENGTH,WIDTH,HEIGHT); for (i = 0; i < boxes; i++) dsDrawBox (box[i].getPosition(),box[i].getRotation(),sides); dsSetColor (1,1,1); for (i=0; i< spheres; i++) dsDrawSphere (sphere[i].getPosition(),
DVector3C l = geomINT.getLengths(); DMatrix3C rotBox = geomW.getRotation(); DVector3C l = geomANCHOR.getLengths(); DMatrix3C rotBox = geomD.getRotation(); DVector3C posBox = geomD.getPosition();