/** * Get the angular velocity of a body. * @param b b * @return ret * */ //ODE_API //const double * public static DVector3C dBodyGetAngularVel (DBody b){ return b.getAngularVel(); }
/** * Get the angular velocity of a body. * @param b b * @return ret * */ //ODE_API //const double * public static DVector3C dBodyGetAngularVel (DBody b){ return b.getAngularVel(); }
private DVector3 getDragTorque(double density, DBody odeBody, double area) { DVector3 dragTorque = new DVector3(odeBody.getAngularVel()); double avel = dragTorque.length(); dragTorque.safeNormalize(); dragTorque.scale(-0.5 * density * area * avel * avel * 0.5); return dragTorque; }
private void dampRotationalMotion (double kd) { DVector3C w = body[0].getAngularVel(); body[0].addTorque (-kd*w.get0(),-kd*w.get1(),-kd*w.get2()); }
DVector3C rot = dyn_bodies[b].getAngularVel(); rot = dyn_bodies[b].getAngularVel(); double s = 1.00; double t = 0.99;
if (iteration >= 100) { DVector3C w1 = anchor_body.getAngularVel (); DVector3C w2 = test_body.getAngularVel (); DQuaternionC q1 = anchor_body.getQuaternion (); DQuaternionC q2 = test_body.getQuaternion ();
/** * This is the explicit computation of * gyroscopic forces. */ private static void expStep(DBody body) { // Explicit computation DMatrix3 I = new DMatrix3(), tmp = new DMatrix3(); DMassC m = body.getMass(); DMatrix3C R = body.getRotation(); // compute inertia tensor in global frame OdeMath.dMultiply2_333 (tmp,m.getI(),R); OdeMath.dMultiply0_333 (I,R,tmp); // compute explicit rotational force // we treat 'tmp'like a vector, but that's okay. DVector3C w = body.getAngularVel(); OdeMath.dMultiply0_331 (tmp,I,w); DVector3 tau = new DVector3(); DVector3 tmp2 = new DVector3(tmp.get00(), tmp.get01(), tmp.get02()); OdeMath.dCalcVectorCross3(tau,tmp2,w); body.addTorque(tau); }
if (!pause) { final DVector3C w = body[0].getAngularVel (); body[0].addTorque ( kd*w.get0(), kd*w.get1()+0.1*Math.cos(a), kd*w.get2()+0.1*Math.sin(a)); world.step (0.05);
DVector3C w = body[0].getAngularVel(); body[0].addTorque (kd*w.get0(),kd*w.get1()+0.1*Math.cos(a),kd*w.get2()+0.1*Math.sin(a)); a += 0.01;
if (lspeed > DISABLE_THRESHOLD) disable = false; DVector3C avel = b.getAngularVel(); double aspeed = avel.lengthSquared(); if (aspeed > DISABLE_THRESHOLD)