/** * Check if a mass structure has valid value. * The function check if the mass and inertia matrix are positive definits * * @param m A mass structure to check * * @return 1 if both condition are met */ //ODE_API public static boolean dMassCheck(DMassC m) { return m.check(); }
/** * Check if a mass structure has valid value. * The function check if the mass and inertia matrix are positive definits * * @param m A mass structure to check * * @return 1 if both condition are met */ //ODE_API public static boolean dMassCheck(DMassC m) { return m.check(); }
public void dBodySetMass (DMassC mass2) { //dAASSERT (mass2 ); dIASSERT(mass2.check()); // The centre of mass must be at the origin. // Use dMassTranslate( mass, -mass->c[0], -mass->c[1], -mass->c[2] ) // to correct it. DVector3C mass2c = mass2.getC(); dUASSERT( Math.abs( mass2c.get0() ) <= DBL_EPSILON && Math.abs( mass2c.get1() ) <= DBL_EPSILON && Math.abs( mass2c.get2() ) <= DBL_EPSILON, "The centre of mass must be at the origin." ); //memcpy (b.mass,mass,sizeof(dMass)); mass.set(mass2); if (!dInvertPDMatrix (mass._I, invI)) { dDEBUGMSG ("inertia must be positive definite!"); invI.setIdentity(); } invMass = dRecip(mass._mass); }
public void dBodySetMass (DMassC mass2) { //dAASSERT (mass2 ); dIASSERT(mass2.check()); // The centre of mass must be at the origin. // Use dMassTranslate( mass, -mass->c[0], -mass->c[1], -mass->c[2] ) // to correct it. DVector3C mass2c = mass2.getC(); dUASSERT( Math.abs( mass2c.get0() ) <= DBL_EPSILON && Math.abs( mass2c.get1() ) <= DBL_EPSILON && Math.abs( mass2c.get2() ) <= DBL_EPSILON, "The centre of mass must be at the origin." ); //memcpy (b.mass,mass,sizeof(dMass)); mass.set(mass2); if (!dInvertPDMatrix (mass._I, invI)) { dDEBUGMSG ("inertia must be positive definite!"); invI.setIdentity(); } invMass = dRecip(mass._mass); }