/** * Empty a joint group. * * All joints in the joint group will be destroyed, * but the joint group itself will not be destroyed. * @param g g */ //ODE_API public static void dJointGroupEmpty (DJointGroup g) { g.empty(); }
/** * Destroy a joint group. * * All joints in the joint group will be destroyed. * @param g g */ //ODE_API public static void dJointGroupDestroy (DJointGroup g) { g.destroy(); }
joints.clear();
joints.clear();
/** * Empty a joint group. * * All joints in the joint group will be destroyed, * but the joint group itself will not be destroyed. * @param g g */ //ODE_API public static void dJointGroupEmpty (DJointGroup g) { g.empty(); }
/** * Destroy a joint group. * * All joints in the joint group will be destroyed. * @param g g */ //ODE_API public static void dJointGroupDestroy (DJointGroup g) { g.destroy(); }
@Override public void step(boolean pause) { space.collide (null,nearCallback); DxQuickStep.mtIterations.set(0); if (!pause) { final double step = 0.005; final int nsteps = 4; for (int i=0; i<nsteps; ++i) { world.quickStep(step); } } contactgroup.empty(); // now we draw everything for (DGeom g : space.getGeoms()) { drawGeom(g); } }
/** * Delete the bodies, etc. */ private void clear() { if (contactgroup != null) { contactgroup.destroy(); } if (space != null) { space.destroy(); } if (world != null) { world.destroy(); } }
@Override public void step(boolean pause) { if (!pause) { space.collide(null, nearCallback); world.quickStep(0.01); contactgroup.empty(); } dsSetColor (1,1,0); for (int i=0; i<ncards; ++i) { dsSetColor (1, ((float)i)/ncards, 0); cards.get(i).draw(); } }
private void shutdownSimulation() { // destroy world if it exists if (bodies!=0) { //TODO // threading.shutdownProcessing();//dThreadingImplementationShutdownProcessing(threading); // pool.freeThreadPool(); // world.setStepThreadingImplementation(null, null); // threading.free(); contactgroup.destroy (); space.destroy (); world.destroy (); bodies = 0; } }
@Override public void step(boolean pause) { space.collide (null,nearCallback); if (!pause) { final double step = 0.005; final int nsteps = 4; for (int i=0; i<nsteps; ++i) { world.quickStep(step); } } contactgroup.empty(); // now we draw everything for (DGeom g : space.getGeoms()) { drawGeom(g); } }
@Override public void stop() { ragdoll.destroy(); contactgroup.destroy(); space.destroy(); world.destroy(); }
void simLoop (boolean pause) { if (!pause) { final double step = 0.02; final int nsteps = 1; for (int i=0; i<nsteps; ++i) { OdeHelper.spaceCollide(space, null, nearCallback); world.quickStep(step); contact_group.empty(); } } else { OdeHelper.spaceCollide(space, null, nearCallback); contact_group.empty(); } // now we draw everything for (DGeom g : space.getGeoms()) { if (g == ground) continue; // drawstuff is already drawing it for us drawGeom(g); } if (ball1_body.getPosition().get0() < -track_len) resetSim(); }
@Override public void stop() { for (int x = 0; x < RAGDOLLS * RAGDOLLS; x++) { ragdolls[x].destroy(); } contactgroup.destroy(); space.destroy(); world.destroy(); }
@Override public void step (boolean pause) { int i; if (!pause) { //static double angle = 0; angle += 0.05; body[NUM-1].addForce(0,0,1.5*(Math.sin(angle)+1.0)); space.collide(0,myNearCallback); world.step(0.05); /* remove all contact joints */ contactgroup.empty(); } dsSetColor (1,1,0); dsSetTexture (DS_TEXTURE_NUMBER.DS_WOOD); for (i=0; i<NUM; i++) dsDrawSphere (body[i].getPosition(), body[i].getRotation(),RADIUS); }