/** * Set the angular velocity of a body. * @param b b * @param x x * @param y y * @param z z * */ //ODE_API public static void dBodySetAngularVel (DBody b, double x, double y, double z){ b.setAngularVel(x, y, z); }
/** * Set the angular velocity of a body. * @param b b * @param x x * @param y y * @param z z * */ //ODE_API public static void dBodySetAngularVel (DBody b, double x, double y, double z){ b.setAngularVel(x, y, z); }
void resetBall(DBody b, int idx) { b.setPosition( 0.5*track_len*Math.cos(track_incl) // Z - 0.5*track_height*Math.sin(track_incl) - ball_radius, // X balls_sep*idx, // Y track_elevation + ball_radius// Z + 0.5*track_len*Math.sin(track_incl) + 0.5*track_height*Math.cos(track_incl)); // DMatrix3 r = new DMatrix3(1, 0, 0, 0, // 0, 1, 0, 0, // 0, 0, 1, 0); DMatrix3 r = new DMatrix3(1, 0, 0, 0, 1, 0, 0, 0, 1); b.setRotation(r); b.setLinearVel(0, 0, 0); b.setAngularVel(0, 0, 0); }
private void reset() { DMatrix3 R = new DMatrix3(); R.setIdentity(); top1.setRotation(R); top2.setRotation(R); top1.setPosition(0.8f, -2, 2); top2.setPosition(0.8f, 2, 2); top1.setAngularVel(1,0,7); top2.setAngularVel(1,0,7); top1.setLinearVel(0,0.2f,0); top2.setLinearVel(0,0.2f,0); }
private void reset() { DMatrix3 R = new DMatrix3(); R.setIdentity(); top1.setRotation(R); top2.setRotation(R); top1.setPosition(0.8f, -2, 2); top2.setPosition(0.8f, 2, 2); top1.setAngularVel(0,0,5); top2.setAngularVel(0,0,5); top1.setLinearVel(0,0.2f,0); top2.setLinearVel(0,0.2f,0); }
private void reset_state() { float sx=-4, sy=-4, sz=2; DQuaternion q = new DQuaternion(); dQFromAxisAndAngle (q,1,0,0,M_PI*0.5); if (BOX) { boxbody.setPosition (sx, sy+1, sz); boxbody.setLinearVel (0,0,0); boxbody.setAngularVel (0,0,0); boxbody.setQuaternion (q); } if (CYL) { cylbody.setPosition (sx, sy, sz); cylbody.setLinearVel (0,0,0); cylbody.setAngularVel (0,0,0); cylbody.setQuaternion (q); } }
private void reset_ball() { float sx=0.0f, sy=2.973f, sz=7.51f; // //#if defined(_MSC_VER) && defined(dDOUBLE) // //sy -= 0.01; // Cheat, to make it score under win32/double // //#endif sy += 0.033; // Windows 64 //TODO //sy += 0.046; //For 'double' on Linux 64bit. //TODO !!! DQuaternion q = new DQuaternion(); q.setIdentity(); sphbody.setPosition (sx, sy, sz); sphbody.setQuaternion(q); sphbody.setLinearVel (0,0,0); sphbody.setAngularVel (0,0,0); }
private void reset_ball() { float sx=0.0f, sy=3.40f, sz=7.15f; // //#if defined(_MSC_VER) && defined(dDOUBLE) // //sy -= 0.01; // Cheat, to make it score under win32/double // //#endif sy += 0.033; // Windows 64 //TODO //sy += 0.046; //For 'double' on Linux 64bit. //TODO !!! DQuaternion q = new DQuaternion(); q.setIdentity(); sphbody.setPosition (sx, sy, sz); sphbody.setQuaternion(q); sphbody.setLinearVel (0,0,0); sphbody.setAngularVel (0,0,0); }
noGyroBody.setAngularVel(omega); expGyroBody.setAngularVel(omega); impGyroBody.setAngularVel(omega);
quat.set(q0, 0, 0, q3); dyn_bodies[b].setQuaternion (quat); dyn_bodies[b].setAngularVel (0, 0, rot.get2()); dyn_bodies[b].setAngularVel( rot.reScale(t));
sphereGeom[ii].setBody(sphereBody[ii]); sphereBody[ii].setPosition(xPos,yPos,zPos); sphereBody[ii].setAngularVel(0,omega,0);
body1.setAngularVel(0, 0, 0); body2.setAngularVel(0, 0, 0);
double force = 10; cannon_ball_body.setLinearVel (force*R4.get(0, 2),force*R4.get(1,2),force*R4.get(2,2)); cannon_ball_body.setAngularVel (0,0,0); break;
body[BODY1].setAngularVel(0,0,0); body[BODY2].setAngularVel(0,0,0);
body[BODY1].setAngularVel(0,0,0); body[BODY2].setAngularVel(0,0,0);
bone.body.disable(); bone.body.setLinearVel(0, 0, 0); bone.body.setAngularVel(0, 0, 0); bone.body.setPosition(bone.position); bone.body.setQuaternion(bone.quaternion);
bone.body.disable(); bone.body.setLinearVel(0, 0, 0); bone.body.setAngularVel(0, 0, 0); bone.body.setPosition(bone.position); bone.body.setQuaternion(bone.quaternion);
body[i].setAngularVel (dRandReal()*2-1,dRandReal()*2-1, dRandReal()*2-1);