Package com.ngt.jopenmetaverse.shared.types

Examples of com.ngt.jopenmetaverse.shared.types.Vector3.normalize()


    Vector3 eye = new Vector3(eyeX, eyeY, eyeZ);
    Vector3 center = new Vector3(centerX, centerY, centerZ);
    Vector3 up = new Vector3(upX, upY, upZ);
   
    Vector3 f = Vector3.subtract(center, eye);
    f.normalize();
//    Vector3 up2 = new Vector3(up);
//    up2.normalize();
   
    Vector3 s = Vector3.cross(f, up);
    s.normalize();
View Full Code Here


    f.normalize();
//    Vector3 up2 = new Vector3(up);
//    up2.normalize();
   
    Vector3 s = Vector3.cross(f, up);
    s.normalize();
    Vector3 u = Vector3.cross(s, f);
//   
//    float[][] m =    new float[][] {
//                new float[] { s.X, u.X, -1 * f.X, 0},
//                new float[] { s.Y, u.Y, -1 * f.Y, 0},
View Full Code Here

          public void Pan(float deltaX, float deltaY)
          {
              Manual = true;
              Vector3 direction = Vector3.subtract(getPosition(), getFocalPoint());
              direction.normalize();
              Vector3 vy = Vector3.modulus(direction, Vector3.UnitZ);
              Vector3 vx = Vector3.modulus(vy, direction);
              Vector3 vxy = Vector3.multiply(vx, deltaY).add(Vector3.multiply(vy, deltaX));
              getPosition().add(vxy);
              getFocalPoint().add(vxy);
View Full Code Here

               // Prevent left from being zero
               at.X += 0.01f;
               at.normalize();
               left = Vector3.cross(upDirection, at);
           }
           left.normalize();

           xAxis = at;
           yAxis = left;
           zAxis = Vector3.cross(at, left);
       }
View Full Code Here

       public void LookAt(Vector3 origin, Vector3 target, Vector3 upDirection)
       {
           this.origin = origin;
           Vector3 at = Vector3.subtract(target, origin);
           at.normalize();

           LookDirection(at, upDirection);
       }

       //endregion Public Methods
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.