Package jinngine.math

Examples of jinngine.math.Matrix3.multiply()


    };
   
   
    // apply transform to all points
    for (Vector3 p: faceA) {
      p.assign( Binv.multiply(p.sub(midpoint)));
    }
    for (Vector3 p: faceB) {
      p.assign( Binv.multiply(p.sub(midpoint)));
    }
   
View Full Code Here


    // apply transform to all points
    for (Vector3 p: faceA) {
      p.assign( Binv.multiply(p.sub(midpoint)));
    }
    for (Vector3 p: faceB) {
      p.assign( Binv.multiply(p.sub(midpoint)));
    }
   
    // run 2d intersection
    ORourke.run(faceA, faceB, handler);
   
View Full Code Here

    public void testMultiplyVector01() {
        final Matrix3 m = new Matrix3(1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.);
        final Vector3 v = new Vector3(10., 100., 1000.);
        final Vector3 r = m.multiply(v);
        assertNotSame(r, v);//new Vector3 is returned
        //Input is not changed
        assertMatrixEquals(new double[]{
                    1., 2., 3.,
                    4., 5., 6.,
View Full Code Here

    final Matrix3 M1 = b1.state.inverseanisotropicmass;
    final Matrix3 I2 = b2.state.inverseinertia;
    final Matrix3 M2 = b2.state.inverseanisotropicmass;
    final Vector3 nB1 = M1.multiply(nJ1);
    final Vector3 nB2 = I1.multiply(nJ2);
    final Vector3 nB3 = M2.multiply(nJ3);
    final Vector3 nB4 = I2.multiply(nJ4);

    // clear out B's if mass is "infinity"
    if (b1.isFixed()) { nB1.assignZero(); nB2.assignZero(); }
    if (b2.isFixed()) { nB3.assignZero(); nB4.assignZero(); }
View Full Code Here

    final Vector3 t2J2 = r1.cross(t2);
    final Vector3 t2J3 = t2.negate();
    final Vector3 t2J4 = r2.cross(t2).negate();
    final Vector3 t2B1 = b1.isFixed()? new Vector3(): M1.multiply(t2J1);
    final Vector3 t2B2 = b1.isFixed()new Vector3(): I1.multiply(t2J2);
    final Vector3 t2B3 = b2.isFixed()? new Vector3(): M2.multiply(t2J3);
    final Vector3 t2B4 = b2.isFixed()? new Vector3(): I2.multiply(t2J4);

    //then the tangential friction constraints
    double ut1i = t2J1.dot(b1.state.velocity) + t2J2.dot(b1.state.omega) + t2J3.dot(b2.state.velocity) + t2J4.dot(b2.state.omega); //relativeVelocity(b1,b2,p,t2);
    double ut1f = 0;
View Full Code Here

    final Vector3 t3J2 = r1.cross(t3);
    final Vector3 t3J3 = t3.negate();
    final Vector3 t3J4 = r2.cross(t3).negate();
    final Vector3 t3B1 = b1.isFixed()? new Vector3(): M1.multiply(t3J1);
    final Vector3 t3B2 = b1.isFixed()? new Vector3(): I1.multiply(t3J2);
    final Vector3 t3B3 = b2.isFixed()? new Vector3(): M2.multiply(t3J3);
    final Vector3 t3B4 = b2.isFixed()? new Vector3(): I2.multiply(t3J4);

    double ut2i = t3J1.dot(b1.state.velocity) + t3J2.dot(b1.state.omega) + t3J3.dot(b2.state.velocity) + t3J4.dot(b2.state.omega); //relativeVelocity(b1,b2,p,t2);
    double ut2f = 0;
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.