Package com.ngt.jopenmetaverse.shared.types

Examples of com.ngt.jopenmetaverse.shared.types.Vector3


            pctX, pctY);
        heightRange = Utils.clamp(heightRange, 0f, 255f);

        // Generate two frequencies of perlin noise based on our global position
        // The magic values were taken from http://opensimulator.org/wiki/Terrain_Splatting
        Vector3 vec = new Vector3
            (
                newX * 0.20319f,
                newY * 0.20319f,
                height * 0.25f
                );
 
View Full Code Here


//        Camera.Position = camPos;
//        Camera.FocalPoint = myself.RenderPosition + new Vector3(5, 0, 0) * client.self.Movement.BodyRotation;
   
       

        Vector3 camPos = Vector3.add(client.self.getSimPosition(), Vector3.multiply(new Vector3(-4, 0, 1), client.self.Movement.BodyRotation));
        camera.setPosition(camPos);
        camera.setFocalPoint(Vector3.add(client.self.getSimPosition(), Vector3.multiply(new Vector3(5, 0, 0), client.self.Movement.BodyRotation)));
       
        client.self.Movement.SendUpdate(false);
//   
//    else if(keycode == Keyboard.KEY_W)
//      translateY += 1;
View Full Code Here

   }

  public void initCamera()
  {
      this.camera = new Camera();
          Vector3 camPos = Vector3.add(client.self.getSimPosition(),
              Vector3.multiply(new Vector3(-4, 0, 1), client.self.Movement.BodyRotation));
         
          camera.setPosition(camPos);
      System.out.println(String.format("Initial Camera Position %s Sim Pos %s ", camPos.toString(), client.self.getSimPosition().toString()));
          camera.setFocalPoint(Vector3.add(client.self.getSimPosition(), Vector3.multiply(new Vector3(5, 0, 0), client.self.Movement.BodyRotation)));
          camera.Zoom = 1.0f;
          //TODO need to set it following properly. Actually it means upto how far objects should be rendered
          camera.Far = 100;
  }
View Full Code Here

  /// <summary>
  /// Task performed the fist time object is set for rendering
  /// </summary>
  public void Initialize()
  {
    InterpolatedPosition = new Vector3(getBasePrim().Position);
    RenderPosition =   new Vector3(getBasePrim().Position);
    InterpolatedRotation = new Quaternion(getBasePrim().Rotation);
    RenderRotation = new Quaternion(getBasePrim().Rotation);
    Initialized = true;
  }
View Full Code Here

    // Don't interpolate when parent changes (sit/stand link/unlink)
    if (previousParent != getBasePrim().ParentID)
    {
      previousParent = getBasePrim().ParentID;
      InterpolatedPosition = new Vector3(getBasePrim().Position);
      InterpolatedRotation = new Quaternion(getBasePrim().Rotation);
      return;
    }

    // Linear velocity and acceleration
    if (!getBasePrim().Velocity.equals(Vector3.Zero))
    {
      getBasePrim().Position =  Vector3.multiply(getBasePrim().Velocity,  time
          * 0.98f * dilation).add( getBasePrim().Position);
      InterpolatedPosition = new Vector3(getBasePrim().Position);
      getBasePrim().Velocity = Vector3.multiply(getBasePrim().Acceleration, time).add(getBasePrim().Velocity);
    }
    else if (!InterpolatedPosition.equals(getBasePrim().Position))
    {
      InterpolatedPosition = RHelp.Smoothed1stOrder(InterpolatedPosition, getBasePrim().Position, time);
    }

    // Angular velocity (target omega)
    if (!(getBasePrim().AngularVelocity.equals(Vector3.Zero)))
    {
      Vector3 angVel = getBasePrim().AngularVelocity;
      float angle = time * angVel.length();
      Quaternion dQ = Quaternion.createFromAxisAngle(angVel, angle);
      InterpolatedRotation = Quaternion.multiply(dQ, InterpolatedRotation);
    }
    else if (!(InterpolatedRotation.equals(getBasePrim().Rotation)) && !(this instanceof RenderAvatar))
    {
View Full Code Here

       float    centerZ,
       float    upX,
       float    upY,
       float    upZ)
  {
    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();
    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},
//                new float[] { s.Z, u.Z, -1 * f.Z, 0},
View Full Code Here

//        Camera.Position = camPos;
//        Camera.FocalPoint = myself.RenderPosition + new Vector3(5, 0, 0) * client.self.Movement.BodyRotation;
   
       

        Vector3 camPos = Vector3.add(client.self.getSimPosition(), Vector3.multiply(new Vector3(-4, 0, 1), client.self.Movement.BodyRotation));
        camera.setPosition(camPos);
        camera.setFocalPoint(Vector3.add(client.self.getSimPosition(), Vector3.multiply(new Vector3(5, 0, 0), client.self.Movement.BodyRotation)));
       
        client.self.Movement.SendUpdate(false);
//   
//    else if(keycode == Keyboard.KEY_W)
//      translateY += 1;
View Full Code Here

   }

  public void initCamera()
  {
      this.camera = new Camera();
          Vector3 camPos = Vector3.add(client.self.getSimPosition(),
              Vector3.multiply(new Vector3(-4, 0, 1), client.self.Movement.BodyRotation));
         
          camera.setPosition(camPos);
      System.out.println(String.format("Initial Camera Position %s Sim Pos %s ", camPos.toString(), client.self.getSimPosition().toString()));
          camera.setFocalPoint(Vector3.add(client.self.getSimPosition(), Vector3.multiply(new Vector3(5, 0, 0), client.self.Movement.BodyRotation)));
          camera.Zoom = 1.0f;
          //TODO need to set it following properly. Actually it means upto how far objects should be rendered
          camera.Far = 100;
  }
View Full Code Here

          { mModified = value; }

          public Camera()
          {
            mModified = false;
            mPosition = new Vector3();
            mFocalPoint = new Vector3();
            RenderPosition = new Vector3();
            RenderFocalPoint = new Vector3();
          }
View Full Code Here

          }

          Vector3 Interpolate(Vector3 start, Vector3 end, float fraction)
          {
//              float distance = Vector3.distance(start, end);
              Vector3 direction = Vector3.subtract(end, start);
              return direction.multiply(fraction).add(start);
          }
View Full Code Here

TOP

Related Classes of com.ngt.jopenmetaverse.shared.types.Vector3

Copyright © 2018 www.massapicom. 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.