jglcore
Class JGL_3DVector

java.lang.Object
  extended by jglcore.JGL_3DVector

public final class JGL_3DVector
extends java.lang.Object

Representation of a vector in 3D space.

Author:
Nicolas Devere

Field Summary
 float x
          The X value
 float y
          The Y value
 float z
          The Z value
 
Constructor Summary
JGL_3DVector()
          Constructs a neutral vector.
JGL_3DVector(float _x, float _y, float _z)
          Constructs a vector given its 3 components.
 
Method Summary
 void assign(JGL_3DVector v)
          Assigns values of the specified vector to this vector.
 boolean equals(JGL_3DVector v)
          Returns if the specified vector's components are equals to this vector's.
 float norm()
          Returns the vector's norm.
 void normalize()
          Normalizes the vector.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public float x
The X value


y

public float y
The Y value


z

public float z
The Z value

Constructor Detail

JGL_3DVector

public JGL_3DVector()
Constructs a neutral vector.


JGL_3DVector

public JGL_3DVector(float _x,
                    float _y,
                    float _z)
Constructs a vector given its 3 components.

Parameters:
_x - : the X value
_y - : the Y value
_z - : the Z value
Method Detail

assign

public void assign(JGL_3DVector v)
Assigns values of the specified vector to this vector.

Parameters:
v - : the matrix to assign

equals

public boolean equals(JGL_3DVector v)
Returns if the specified vector's components are equals to this vector's.

Parameters:
v - : the vector to compare
Returns:
true if equality, false otherwise

norm

public float norm()
Returns the vector's norm.

Returns:
the vector's norm

normalize

public void normalize()
Normalizes the vector.