public static void dRSetIdentity (DMatrix3 R) { R.setIdentity(); }
public static void dRSetIdentity (DMatrix3 R) { R.setIdentity(); }
public static void dRSetIdentity (DMatrix3 R) { R.setIdentity(); }
public static void dRSetIdentity (DMatrix3 R) { R.setIdentity(); }
/** * @param R R * @deprecated Use DMatrix.setIdentity() instead. */ @Deprecated public static void dRSetIdentity (DMatrix3 R) { //dAASSERT (R); //SET_3x3_IDENTITY; R.setIdentity(); }
/** * @param R R * @deprecated Use DMatrix.setIdentity() instead. */ @Deprecated public static void dRSetIdentity (DMatrix3 R) { //dAASSERT (R); //SET_3x3_IDENTITY; R.setIdentity(); }
private void drawAABB(DGeom g) { if (show_aabb) { // draw the bounding box for this geom DAABBC aabb = g.getAABB(); DVector3 bbpos = aabb.getCenter(); DVector3 bbsides = aabb.getLengths(); DMatrix3 RI = new DMatrix3(); RI.setIdentity (); dsSetColorAlpha (1,0,0,0.5f); dsDrawBox (bbpos,RI,bbsides); } }
private void drawAABB(DGeom g) { if (show_aabb) { // draw the bounding box for this geom DAABBC aabb = g.getAABB(); DVector3 bbpos = aabb.getCenter(); DVector3 bbsides = aabb.getLengths(); DMatrix3 RI = new DMatrix3(); RI.setIdentity (); dsSetColorAlpha (1,0,0,0.5f); dsDrawBox (bbpos,RI,bbsides); } }
private void drawAABB(DGeom g) { if (show_aabb) { // draw the bounding box for this geom DAABBC aabb = g.getAABB(); DVector3 bbpos = aabb.getCenter(); DVector3 bbsides = aabb.getLengths(); DMatrix3 RI = new DMatrix3(); RI.setIdentity (); dsSetColorAlpha (1,0,0,0.5f); dsDrawBox (bbpos,RI,bbsides); } }
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); }
private void dGeomCreateOffset () { //dAASSERT (g); dUASSERT (_gflags & GEOM_PLACEABLE,"geom must be placeable"); dUASSERT (body, "geom must be on a body"); if (offset_posr != null) { return; // already created } dIASSERT (_final_posr == body._posr); _final_posr = dAllocPosr(); offset_posr = dAllocPosr(); offset_posr.pos.setZero();//dSetZero (offset_posr.pos.v,4); offset_posr.Rw().setIdentity(); _gflags |= GEOM_POSR_BAD; }
private void dGeomCreateOffset () { //dAASSERT (g); dUASSERT (_gflags & GEOM_PLACEABLE,"geom must be placeable"); dUASSERT (body, "geom must be on a body"); if (offset_posr != null) { return; // already created } dIASSERT (_final_posr == body._posr); _final_posr = dAllocPosr(); offset_posr = dAllocPosr(); offset_posr.pos.setZero();//dSetZero (offset_posr.pos.v,4); offset_posr.Rw().setIdentity(); _gflags |= GEOM_POSR_BAD; }
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); }
void testRotationFunctions() { DMatrix3 R1 = new DMatrix3(); HEADER(); printf ("\tdRSetIdentity - "); dMakeRandomMatrix (R1,1.0); R1.setIdentity(); if (cmpIdentityMat3(R1)) printf ("passed\n"); else printf ("FAILED\n"); printf ("\tdRFromAxisAndAngle - "); printf ("\n"); printf ("\tdRFromEulerAngles - "); printf ("\n"); printf ("\tdRFrom2Axes - "); printf ("\n"); }
private void testRotationFunctions() { DMatrix3 R1 = new DMatrix3(); HEADER(); print ("\tdRSetIdentity - "); dMakeRandomMatrix (R1,1.0); R1.setIdentity(); if (cmpIdentityMat3(R1)) println ("passed"); else println ("FAILED"); print ("\tdRFromAxisAndAngle - "); println (""); print ("\tdRFromEulerAngles - "); println (""); print ("\tdRFrom2Axes - "); println (""); }
private void nearCallback (Object data, DGeom o1, DGeom o2) { // for drawing the contact points DMatrix3 RI = new DMatrix3(); RI.setIdentity (); DVector3C ss = new DVector3(0.02,0.02,0.02); DBody b1 = o1.getBody(); DBody b2 = o2.getBody(); DContactBuffer contacts = new DContactBuffer(MAX_CONTACTS); int numc = OdeHelper.collide (o1,o2,MAX_CONTACTS,contacts.getGeomBuffer()); for (int i=0; i<numc; i++) { contacts.get(i).surface.mode = OdeConstants.dContactApprox1; contacts.get(i).surface.mu = 2; DJoint c = OdeHelper.createContactJoint (world,contactgroup,contacts.get(i)); c.attach (b1,b2); if (show_contacts) dsDrawBox (contacts.get(i).geom.pos, RI, ss); } }
void dMatrix3Inv( final DMatrix3 ma, DMatrix3 dst ) { double det = dMatrix3Det( ma ); if ( dFabs( det ) < (0.0005) ) { dst.setIdentity(); return; } double detRecip = 1.0 / det; dst.set00( (ma.get11()*ma.get22() - ma.get12()*ma.get21()) * detRecip ); dst.set01( (ma.get21()*ma.get02() - ma.get01()*ma.get22()) * detRecip ); dst.set02( (ma.get01()*ma.get12() - ma.get11()*ma.get02()) * detRecip ); dst.set10( (ma.get12()*ma.get20() - ma.get10()*ma.get22()) * detRecip ); dst.set11( (ma.get00()*ma.get22() - ma.get20()*ma.get02()) * detRecip ); dst.set12( (ma.get10()*ma.get02() - ma.get00()*ma.get12()) * detRecip ); dst.set20( (ma.get10()*ma.get21() - ma.get20()*ma.get11()) * detRecip ); dst.set21( (ma.get20()*ma.get01() - ma.get00()*ma.get21()) * detRecip ); dst.set22( (ma.get00()*ma.get11() - ma.get01()*ma.get10()) * detRecip ); }
void dMatrix3Inv( final DMatrix3 ma, DMatrix3 dst ) { double det = dMatrix3Det( ma ); if ( dFabs( det ) < (0.0005) ) { dst.setIdentity(); return; } double detRecip = 1.0 / det; dst.set00( (ma.get11()*ma.get22() - ma.get12()*ma.get21()) * detRecip ); dst.set01( (ma.get21()*ma.get02() - ma.get01()*ma.get22()) * detRecip ); dst.set02( (ma.get01()*ma.get12() - ma.get11()*ma.get02()) * detRecip ); dst.set10( (ma.get12()*ma.get20() - ma.get10()*ma.get22()) * detRecip ); dst.set11( (ma.get00()*ma.get22() - ma.get20()*ma.get02()) * detRecip ); dst.set12( (ma.get10()*ma.get02() - ma.get00()*ma.get12()) * detRecip ); dst.set20( (ma.get10()*ma.get21() - ma.get20()*ma.get11()) * detRecip ); dst.set21( (ma.get20()*ma.get01() - ma.get00()*ma.get21()) * detRecip ); dst.set22( (ma.get00()*ma.get11() - ma.get01()*ma.get10()) * detRecip ); }