/** * Returns a clone of this Matrix. */ @Override public DMatrix3 clone() { return new DMatrix3(this); }
/** * Create an array of DVector instances. * @param size Size of array * @return An array of DVector */ public final static DMatrix3[] newArray(int size) { DMatrix3[] a = new DMatrix3[size]; for (int i = 0; i < size; i++) { a[i] = new DMatrix3(); } return a; } }
/** * Returns a clone of this Matrix. */ @Override public DMatrix3 clone() { return new DMatrix3(this); }
/** * Create an array of DVector instances. * @param size Size of array * @return An array of DVector */ public final static DMatrix3[] newArray(int size) { DMatrix3[] a = new DMatrix3[size]; for (int i = 0; i < size; i++) { a[i] = new DMatrix3(); } return a; } }
public DxMass() { super(); _c = new DVector3(); _I = new DMatrix3(); dMassSetZero (); }
public DxMass() { super(); _c = new DVector3(); _I = new DMatrix3(); dMassSetZero (); }
private double cmpIdentity (final DMatrix3C A) { DMatrix3 I = new DMatrix3(); I.eqIdentity(); return dMaxDifference (A,I); }
private double cmpIdentity (final DMatrix3C A) { DMatrix3 I = new DMatrix3(); I.setZero();//dSetZero (I,12); // I.v[0] = 1; // I.v[5] = 1; // I.v[10] = 1; I.eqIdentity(); return dMaxDifference (A,I); }
void set(DMassC m) { _mass = m.getMass(); _c = new DVector3(m.getC()); _I = new DMatrix3(m.getI()); }
void set(DMassC m) { _mass = m.getMass(); _c = new DVector3(m.getC()); _I = new DMatrix3(m.getI()); }
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); } }
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); }
/** * Create a new transposed version of this matrix. * @return The transposed copy of this matrix. */ @Override public final DMatrix3 reTranspose() { return new DMatrix3( get00(), get10(), get20(), get01(), get11(), get21(), get02(), get12(), get22()); }
/** * Create a new transposed version of this matrix. * @return The transposed copy of this matrix. */ @Override public final DMatrix3 reTranspose() { return new DMatrix3( get00(), get10(), get20(), get01(), get11(), get21(), get02(), get12(), get22()); }
void getWorldOffsetPosr(final DxPosRC body_posr, final DxPosRC world_posr, DxPosR offset_posr) { DMatrix3 inv_body = new DMatrix3(); matrixInvert(body_posr.R(), inv_body); dMultiply0_333(offset_posr.Rw(), inv_body, world_posr.R()); DVector3 world_offset = new DVector3(); // world_offset.v[0] = world_posr.pos.v[0] - body_posr.pos.v[0]; // world_offset.v[1] = world_posr.pos.v[1] - body_posr.pos.v[1]; // world_offset.v[2] = world_posr.pos.v[2] - body_posr.pos.v[2]; world_offset.eqDiff( world_posr.pos(), body_posr.pos() ); dMultiply0_331(offset_posr.pos, inv_body, world_offset); }
void getBodyPosr(final DxPosR offset_posr, final DxPosR final_posr, DxPosR body_posr) { DMatrix3 inv_offset = new DMatrix3(); matrixInvert(offset_posr.Rw(), inv_offset); dMultiply0_333(body_posr.Rw(), final_posr.R(), inv_offset); DVector3 world_offset = new DVector3(); //TZ dMultiply0_331(world_offset, body_posr.R(), offset_posr.pos()); // body_posr.pos.v[0] = final_posr.pos.v[0] - world_offset.v[0]; // body_posr.pos.v[1] = final_posr.pos.v[1] - world_offset.v[1]; // body_posr.pos.v[2] = final_posr.pos.v[2] - world_offset.v[2]; body_posr.pos.eqDiff( final_posr.pos(), world_offset ); }
void getBodyPosr(final DxPosR offset_posr, final DxPosR final_posr, DxPosR body_posr) { DMatrix3 inv_offset = new DMatrix3(); matrixInvert(offset_posr.Rw(), inv_offset); dMultiply0_333(body_posr.Rw(), final_posr.R(), inv_offset); DVector3 world_offset = new DVector3(); //TZ dMultiply0_331(world_offset, body_posr.R(), offset_posr.pos()); // body_posr.pos.v[0] = final_posr.pos.v[0] - world_offset.v[0]; // body_posr.pos.v[1] = final_posr.pos.v[1] - world_offset.v[1]; // body_posr.pos.v[2] = final_posr.pos.v[2] - world_offset.v[2]; body_posr.pos.eqDiff( final_posr.pos(), world_offset ); }