Package jinngine.math

Examples of jinngine.math.Vector3.normalize()


    final Vector3 p4 = poly.get(1);
    final Vector3 p5 = poly.get(2);
    // counter clock-wise normal
    final Vector3 poly1normal = p5.sub(p3).cross(p3.sub(p4));
    // return
    normal.assign(poly1normal.normalize());
  }
 
  /**
   * Return true if p is contained inside poly. Poly is required to contain at least 3 affine independent points
   * @param p
View Full Code Here


//    Vector3 posError = b1.state.rCm.add(b1.state.q.rotate(p1)).minus(b2.state.rCm).minus(b2.state.q.rotate(p2)).multiply(Kcor);
    Vector3 posError = b1.state.position.add(ri).sub(b2.state.position).sub(rj).multiply(1.0/dt);
   
    // correction velocity limit
    if ( posError.norm() > velocitylimit) {
      posError.assign( posError.normalize().multiply(velocitylimit));
    }
   
    u.assign( u.add(posError));
   
   
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.