/** * Set the world's global gravity vector. * * The units are m/s^2, so Earth's gravity vector would be (0,0,-9.81), * assuming that +z is up. The default is no gravity, i.e. (0,0,0). * @param w w * @param x x * @param y y * @param z z */ //ODE_API public static void dWorldSetGravity (DWorld w, double x, double y, double z) { w.setGravity(x, y, z); }
/** * Set the world's global gravity vector. * * The units are m/s^2, so Earth's gravity vector would be (0,0,-9.81), * assuming that +z is up. The default is no gravity, i.e. (0,0,0). * @param w w * @param x x * @param y y * @param z z */ //ODE_API public static void dWorldSetGravity (DWorld w, double x, double y, double z) { w.setGravity(x, y, z); }
world.setGravity(0,0,-9.8);
private void demo(String[] args) { // create world OdeHelper.initODE2( 0 ); world = OdeHelper.createWorld(); space = OdeHelper.createSimpleSpace( null ); contactgroup = OdeHelper.createJointGroup(); world.setGravity( 0,0,-0.5 ); world.setCFM( 1e-5 ); OdeHelper.createPlane( space,0,0,1,0 ); for (int i = 0; i < NUM; i++) obj[i] = new MyObject(); // run simulation dsSimulationLoop( args,352,288,this ); contactgroup.destroy(); space.destroy(); world.destroy(); OdeHelper.closeODE(); }
space = OdeHelper.createHashSpace(); contactgroup = OdeHelper.createJointGroup(); world.setGravity (0,0,-GRAVITY); OdeHelper.createPlane (space,0,0,1,0);
private void demo(String[] args) { OdeHelper.initODE2(0); world = OdeHelper.createWorld(); world.setGravity(0, 0, -0.5); world.setQuickStepNumIterations(50); // <-- increase for more stability space = OdeHelper.createSimpleSpace(null); //space = OdeHelper.createSapSpace(AXES.XYZ); //space = OdeHelper.createBHVSpace(0); contactgroup = OdeHelper.createJointGroup(); DGeom ground = OdeHelper.createPlane(space, 0, 0, 1, 0); place_cards(); // run simulation dsSimulationLoop (args, 640, 480, this); levels = 0; place_cards(); contactgroup.destroy(); world.destroy(); ground.destroy(); space.destroy(); OdeHelper.closeODE(); }
private void demo (String[] args) { OdeHelper.initODE2(0); world = OdeHelper.createWorld(); space = OdeHelper.createSimpleSpace(); contactgroup = OdeHelper.createJointGroup(); world.setGravity (0,0,-9.81); world.setContactMaxCorrectingVel(2.5); world.setMaxAngularSpeed(1); world.setAngularDamping(0.6 * STEP_SIZE); world.setAngularDampingThreshold(0); world.setLinearDampingThreshold(0); world.setLinearDamping(0.6 * STEP_SIZE); for (int i = 0; i < obj.length; i++) obj[i] = new MyObject(); OdeHelper.createPlane( space, 0, 0, 1, 0 ); dsSimulationLoop (args,352,288,this); contactgroup.destroy (); space.destroy (); world.destroy (); OdeHelper.closeODE(); }
world.setGravity(0,0,-9.8); world.setDamping(1e-4, 1e-5);
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; }
world.setGravity(0,0,-9.8); world.setDamping(1e-4, 1e-5); world.setTaskExecutor(new MultiThreadTaskExecutor(4));
world.setGravity(0, 0, -.5);
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(); }
contactgroup = OdeHelper.createJointGroup(); world = OdeHelper.createWorld(); world.setGravity (0,0,-0.5); world.setCFM (1e-5); space = OdeHelper.createSimpleSpace(null);
contactgroup = OdeHelper.createJointGroup(); world = OdeHelper.createWorld(); world.setGravity (0,0,-0.5); dWorldSetCFM (world,1e-5); OdeHelper.createPlane(space,0,0,1,0);
space = OdeHelper.createHashSpace(null); contactgroup = OdeHelper.createJointGroup(); world.setGravity(0,0,-GRAVITY); world.setCFM (1e-5); world.setAutoDisableFlag (true);
world.setGravity (0,0,-0.5); world.setCFM (1e-5);
space = OdeHelper.createHashSpace(null); contactgroup = OdeHelper.createJointGroup (); world.setGravity (0, 0, -0.5); OdeHelper.createPlane (space,0,0,1,0);
world.setGravity(0,0,-9.8);
world.setGravity(0,0,-9.8);
space = OdeHelper.createHashSpace (null); contactgroup = OdeHelper.createJointGroup (); world.setGravity (0,0,-9.8); world.setQuickStepNumIterations (32);