/** * Create a body in given world. * * Default mass parameters are at position (0,0,0). * @param w w * @return ret */ //ODE_API public static DBody dBodyCreate (DWorld w){ return OdeHelper.createBody(w); }
/** * Create a body in given world. * * Default mass parameters are at position (0,0,0). * @param w w * @return ret */ //ODE_API public static DBody dBodyCreate (DWorld w){ return OdeHelper.createBody(w); }
Box()// : // body(world), // geom(space, 0.2, 0.2, 0.2) { body = OdeHelper.createBody(world); geom = OdeHelper.createBox(space, 0.2, 0.2, 0.2); DMass mass = OdeHelper.createMass(); mass.setBox(10, 0.2, 0.2, 0.2); body.setMass(mass); geom.setData(this); geom.setBody(body); } void draw() //const
Box()// : // body(world), // geom(space, 0.2, 0.2, 0.2) { body = OdeHelper.createBody(world); geom = OdeHelper.createBox(space, 0.2, 0.2, 0.2); DMass mass = OdeHelper.createMass(); mass.setBox(10, 0.2, 0.2, 0.2); body.setMass(mass); geom.setData(this); geom.setBody(body); } void draw() //const
body1 = OdeHelper.createBody(world); body2 = OdeHelper.createBody(world);
boxMass.setBox(density, sides); noGyroBody = OdeHelper.createBody(world);// Conservation of ang-velocity expGyroBody = OdeHelper.createBody(world);// Explicit conservation of ang-momentum impGyroBody = OdeHelper.createBody(world);// Implicit conservation of ang-momentum
private void constructWorldForTest (double gravity, int bodycount, /* body 1 pos */ double pos1x, double pos1y, double pos1z, /* body 2 pos */ double pos2x, double pos2y, double pos2z, /* body 1 rotation axis */ double ax1x, double ax1y, double ax1z, /* body 1 rotation axis */ double ax2x, double ax2y, double ax2z, /* rotation angles */ double a1, double a2) { // create world world = OdeHelper.createWorld(); world.setERP (0.2); world.setCFM (1e-6); world.setGravity (0,0,gravity); DMass m = OdeHelper.createMass(); m.setBox (1,SIDE,SIDE,SIDE); m.adjust (MASS); body[0] = OdeHelper.createBody (world); body[0].setMass (m); body[0].setPosition(pos1x, pos1y, pos1z); DQuaternion q = new DQuaternion(); dQFromAxisAndAngle (q,ax1x,ax1y,ax1z,a1); body[0].setQuaternion (q); if (bodycount==2) { body[1] = OdeHelper.createBody (world); body[1].setMass (m); body[1].setPosition (pos2x, pos2y, pos2z); dQFromAxisAndAngle (q,ax2x,ax2y,ax2z,a2); body[1].setQuaternion (q); } else body[1] = null; }
Card() { body = OdeHelper.createBody(world); geom = OdeHelper.createBox(space, sides.get0(), sides.get1(), sides.get2()); geom.setBody(body); geom.setData(this); DMass mass = OdeHelper.createMass(); mass.setBox(1, sides.get0(), sides.get1(), sides.get2()); body.setMass(mass); }
private void demo(String[] args) { // create world OdeHelper.initODE2(0); world = OdeHelper.createWorld(); DMass m = OdeHelper.createMass(); m.setBox (1,SIDE,SIDE,SIDE); m.adjust (MASS); body[0] = OdeHelper.createBody (world); body[0].setMass (m); body[0].setPosition (0,0,1); body[1] = OdeHelper.createBody (world); body[1].setMass (m); DQuaternion q = new DQuaternion(); dQFromAxisAndAngle (q,-1,1,0,0.25*M_PI); body[1].setPosition (0.2,0.2,1.2); body[1].setQuaternion (q); slider = OdeHelper.createSliderJoint (world,null); slider.attach (body[0], body[1]); slider.setAxis (1,1,1); // run simulation dsSimulationLoop (args,352,288,this); world.destroy (); OdeHelper.closeODE(); }
dQFromAxisAndAngle (q,1,1,0,0.25 * Math.PI); body[0] = OdeHelper.createBody (world); body[0].setMass (m); body[0].setPosition (0.5*SIDE,0.5*SIDE,1); body[0].setQuaternion (q); body[1] = OdeHelper.createBody (world); body[1].setMass (m); body[1].setPosition (-0.5*SIDE,-0.5*SIDE,1);
world.setGravity(0, 0, -.5); kbody = OdeHelper.createBody(world); kbody.setKinematic(); final double kx = 1, ky = 0, kz = .5; kpole.setOffsetPosition(0, 0, 0.8); matraca = OdeHelper.createBody(world); matraca.setPosition(kx+0, ky+1, kz+1); matraca_geom = OdeHelper.createBox(space, 0.5, 2, 0.75);
body1 = OdeHelper.createBody(world); body2 = OdeHelper.createBody(world);
body1 = OdeHelper.createBody(world); body2 = OdeHelper.createBody(world);
cylbody = OdeHelper.createBody (world); DQuaternion q = new DQuaternion(); if (false) {//#if 0 space.add (cylgeom); sphbody = OdeHelper.createBody(world); m.setSphere (1,SPHERERADIUS); sphbody.setMass (m);
private void demo(String[] args) { int i,j; DMass m = OdeHelper.createMass(); // create world OdeHelper.initODE2(0); world = OdeHelper.createWorld(); space = OdeHelper.createHashSpace (null); contactgroup = OdeHelper.createJointGroup (); world.setGravity (0,0,-GRAVITY); ground = OdeHelper.createPlane (space,0,0,1,0); // bodies for (i=0; i<N1; i++) { for (j=0; j<N2; j++) { body[i][j] = OdeHelper.createBody (world); m.setBox (1,LENGTH,LENGTH,HEIGHT); m.adjust (MASS*(j+1)); body[i][j].setMass (m); body[i][j].setPosition (i*2*LENGTH,j*2*LENGTH,HEIGHT*0.5); box[i][j] = OdeHelper.createBox (space,LENGTH,LENGTH,HEIGHT); box[i][j].setBody (body[i][j]); } } // run simulation dsSimulationLoop (args,352,288,this); contactgroup.destroy(); space.destroy(); world.destroy(); OdeHelper.closeODE(); }
top1 = OdeHelper.createBody(world); top2 = OdeHelper.createBody(world);
body[i] = OdeHelper.createBody(world);//.create (world); double k = i*SIDE; body[i].setPosition (k,k,k+0.4);
p2 = new DVector3(p2); double cyllen = p1.distance(p2) - radius; DBody body = OdeHelper.createBody(world); DMass m = OdeHelper.createMass(); m.setCapsule(1, 3, radius, cyllen);
p2 = new DVector3(p2); double cyllen = p1.distance(p2) - radius; DBody body = OdeHelper.createBody(world); DMass m = OdeHelper.createMass(); m.setCapsule(1, 3, radius, cyllen);
body[i] = OdeHelper.createBody(world); k = i*SIDE; body[i].setPosition(k,k,k+0.4);