Package jinngine.math

Examples of jinngine.math.Vector3.multiply()


      // if motor is working to leave the limit, we need an extra
      // velocity constraint to model the motors contribution at the limit
      if ( joint.motorTargetVelocity>0 && joint.motor>0) {
        joint.extra.assign(
            bi,  bj,
            new Vector3(), bi.isFixed()? new Vector3():bi.state.inverseinertia.multiply(axis), new Vector3(), bj.isFixed()? new Vector3() : bj.state.inverseinertia.multiply(axis.multiply(-1)),
                new Vector3(), axis, new Vector3(), axis.multiply(-1),
                0,
                joint.motor,
                null,
                joint.velocity-joint.motorTargetVelocity, 0 );
View Full Code Here


      // velocity constraint to model the motors contribution at the limit
      if ( joint.motorTargetVelocity>0 && joint.motor>0) {
        joint.extra.assign(
            bi,  bj,
            new Vector3(), bi.isFixed()? new Vector3():bi.state.inverseinertia.multiply(axis), new Vector3(), bj.isFixed()? new Vector3() : bj.state.inverseinertia.multiply(axis.multiply(-1)),
                new Vector3(), axis, new Vector3(), axis.multiply(-1),
                0,
                joint.motor,
                null,
                joint.velocity-joint.motorTargetVelocity, 0 );
View Full Code Here

    // unlimited joint axis
   
   
    joint.angular.assign(
        bi,  bj,
        new Vector3(), bi.isFixed()? new Vector3():bi.state.inverseinertia.multiply(axis), new Vector3(), bj.isFixed()? new Vector3() : bj.state.inverseinertia.multiply(axis.multiply(-1)),
        new Vector3(), axis, new Vector3(), axis.multiply(-1),
        low,
        high,
        null,
        bvalue, 0 );
View Full Code Here

   
   
    joint.angular.assign(
        bi,  bj,
        new Vector3(), bi.isFixed()? new Vector3():bi.state.inverseinertia.multiply(axis), new Vector3(), bj.isFixed()? new Vector3() : bj.state.inverseinertia.multiply(axis.multiply(-1)),
        new Vector3(), axis, new Vector3(), axis.multiply(-1),
        low,
        high,
        null,
        bvalue, 0 );
   
View Full Code Here

    //Forces
    Vector3 Fspring = x.sub(n.multiply(equilibrium)).multiply(this.force); //spring force
    Vector3 Fdamper = n.multiply( (-upax+upbx) * this.damper  ); //damping force
    Vector3 Ftotal = Fspring.add( Fdamper );
       
    a.applyForce( pra, Ftotal.multiply(1), dt );
    b.applyForce( prb, Ftotal.multiply(-1), dt);
  }

}
View Full Code Here

    Vector3 Fspring = x.sub(n.multiply(equilibrium)).multiply(this.force); //spring force
    Vector3 Fdamper = n.multiply( (-upax+upbx) * this.damper  ); //damping force
    Vector3 Ftotal = Fspring.add( Fdamper );
       
    a.applyForce( pra, Ftotal.multiply(1), dt );
    b.applyForce( prb, Ftotal.multiply(-1), dt);
  }

}
View Full Code Here

    nj = b2.toModelNoTranslation(n);
       
    //Use a Gram-Schmidt process to create a orthonormal basis for the impact space
    Vector3 v1 = n.normalize(); Vector3 v2 = Vector3.i(); Vector3 v3 = Vector3.k();
    Vector3 t1 = v1.normalize();
    t2i = v2.sub( t1.multiply(t1.dot(v2)) );
   
    System.out.println(t2i);
   
    //in case v1 and v2 are parallel
    if ( t2i.isEpsilon(Vector3.e) ) {
View Full Code Here

    System.out.println(t2i);
   
    //in case v1 and v2 are parallel
    if ( t2i.isEpsilon(Vector3.e) ) {
      v2 = Vector3.j(); v3 = Vector3.k();
      t2i.assign(v2.sub( t1.multiply(t1.dot(v2)) ).normalize());
    } else {
      t2i.assign(t2i.normalize());
    }
   
    //tangent 2 in j body space
View Full Code Here

    //v1 parallel with v3
    if( v1.cross(v3).isEpsilon(Vector3.e) ) {
      v3 = Vector3.j();
    }
    //finally calculate t3
    t3i = v3.sub( t1.multiply(t1.dot(v3)).sub( t2i.multiply(t2i.dot(v3)) )).normalize();
   
   
    System.out.println(t3i);
   
    // create the controller
View Full Code Here

      // if motor is working to leave the limit, we need an extra
      // velocity constraint to model the motors contribution at the limit
      if ( motorTargetVelocity<0 && motor>0) {
        extra.assign(
            b1,  b2,
            new Vector3(), b1.isFixed()? new Vector3():b1.state.inverseinertia.multiply(axis), new Vector3(), b2.isFixed()? new Vector3() : b2.state.inverseinertia.multiply(axis.multiply(-1)),
            new Vector3(), axis, new Vector3(), axis.multiply(-1),
            -this.motor,
            0,
            null,
            this.velocity-this.motorTargetVelocity, 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.