/** * Get the rotation of a body. * @param b b * * @return pointer to 4 scalars that represent the quaternion. */ //ODE_API //const double * public static DQuaternionC dBodyGetQuaternion (DBody b){ return b.getQuaternion(); }
/** * Get the rotation of a body. * @param b b * * @return pointer to 4 scalars that represent the quaternion. */ //ODE_API //const double * public static DQuaternionC dBodyGetQuaternion (DBody b){ return b.getQuaternion(); }
/** * Copy the orientation of a body into a quaternion. * * @param body the body to query * @param quat a copy of the orientation quaternion * @see #dBodyGetQuaternion(DBody) */ //ODE_API public static void dBodyCopyQuaternion(DBody body, DQuaternion quat){ quat.set(body.getQuaternion()); }
/** * Copy the orientation of a body into a quaternion. * * @param body the body to query * @param quat a copy of the orientation quaternion * @see #dBodyGetQuaternion(DBody) */ //ODE_API public static void dBodyCopyQuaternion(DBody body, DQuaternion quat){ quat.set(body.getQuaternion()); }
DQuaternionC q1 = anchor_body.getQuaternion (); DQuaternionC q2 = test_body.getQuaternion (); double maxdiff = dMaxDifference (w1,w2); System.out.println ("w-error = " + maxdiff + " (" + w1 + ") and (" + w2 + ")");
double ldiff = avgPos.dot(avgPos); DQuaternion adiff = new DQuaternion(); dQMultiply1(adiff, avgQuat, body.getQuaternion()); if (ldiff > linearThreashold || adiff.get0() < angularThreashold) { allIdle = false; for (DxRagdollBody bone : bones) { bone.pBuffer[autoDisableBufferIndex].set(bone.body.getPosition()); bone.qBuffer[autoDisableBufferIndex].set(bone.body.getQuaternion()); if (autoDisabled) { bone.body.disable(); } else { bone.position.set(bone.body.getPosition()); bone.quaternion.set(bone.body.getQuaternion());
double ldiff = avgPos.dot(avgPos); DQuaternion adiff = new DQuaternion(); dQMultiply1(adiff, avgQuat, body.getQuaternion()); if (ldiff > linearThreashold || adiff.get0() < angularThreashold) { allIdle = false; for (DxRagdollBody bone : bones) { bone.pBuffer[autoDisableBufferIndex].set(bone.body.getPosition()); bone.qBuffer[autoDisableBufferIndex].set(bone.body.getQuaternion()); if (autoDisabled) { bone.body.disable(); } else { bone.position.set(bone.body.getPosition()); bone.quaternion.set(bone.body.getQuaternion());
quat_ptr = dyn_bodies[b].getQuaternion();
DBody body = bone.getBody(); DQuaternion qq = new DQuaternion(); OdeMath.dQMultiply1(qq, q, body.getQuaternion()); body.setQuaternion(qq); DMatrix3 R = new DMatrix3();
DBody body = bone.getBody(); DQuaternion qq = new DQuaternion(); OdeMath.dQMultiply1(qq, q, body.getQuaternion()); body.setQuaternion(qq); DMatrix3 R = new DMatrix3();
body.setRotation(new DMatrix3(xa.get0(), ya.get0(), za.get0(), xa.get1(), ya.get1(), za.get1(), xa.get2(), ya.get2(), za.get2())); totalMass += m.getMass(); DxRagdollBody bone = new DxRagdollBody(body, cyllen, radius, body.getPosition(), body.getQuaternion()); bones.add(bone); return bone;
body.setRotation(new DMatrix3(xa.get0(), ya.get0(), za.get0(), xa.get1(), ya.get1(), za.get1(), xa.get2(), ya.get2(), za.get2())); totalMass += m.getMass(); DxRagdollBody bone = new DxRagdollBody(body, cyllen, radius, body.getPosition(), body.getQuaternion()); bones.add(bone); return bone;