Facemorph
Class Vector3

java.lang.Object
  extended by Facemorph.Vector3
All Implemented Interfaces:
java.io.Serializable

public class Vector3
extends java.lang.Object
implements java.io.Serializable

Simple 3D vector class

See Also:
Serialized Form

Field Summary
 float x
          x coord
 float y
          y coord
 float z
          z coord
 
Constructor Summary
Vector3()
          Construct a zero Vector3D
Vector3(float a, float b, float c)
          Construct a full Vector 3D
Vector3(Vector3 p)
          Construct a zero Vector3D
 
Method Summary
 void add(Vector3 p)
           
 float distance(Vector3 p)
           
 float distanceSquared(Vector3 p)
           
 void scale(float s)
           
 void set(float i, float j, float k)
          Set the value of this Vector3D
 void sub(Vector3 p)
           
 Vector3 transform(Matrix3 mat)
          Transform this vector using the matrix given
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public float x
x coord


y

public float y
y coord


z

public float z
z coord

Constructor Detail

Vector3

public Vector3()
Construct a zero Vector3D


Vector3

public Vector3(Vector3 p)
Construct a zero Vector3D


Vector3

public Vector3(float a,
               float b,
               float c)
Construct a full Vector 3D

Parameters:
a - x coord
b - y coord
c - z coord
Method Detail

set

public void set(float i,
                float j,
                float k)
Set the value of this Vector3D

Parameters:
i - the new x value
j - the new y value
k - the new z value

transform

public Vector3 transform(Matrix3 mat)
Transform this vector using the matrix given

Parameters:
mat - The matrix to transform this with
Returns:
The transformed vector

add

public void add(Vector3 p)

scale

public void scale(float s)

distanceSquared

public float distanceSquared(Vector3 p)

distance

public float distance(Vector3 p)

sub

public void sub(Vector3 p)