com.vodafone.v10.graphics.j3d
Class Vector3D

java.lang.Object
  |
  +--com.vodafone.v10.graphics.j3d.Vector3D

public class Vector3D
extends java.lang.Object

3D vector class. Values for X, Y and Z are valid within the range from -32768 to 32767.


Field Summary
 int x
          The x component
 int y
          The y component
 int z
          The z component
 
Constructor Summary
Vector3D()
          Vector3D constructor
Vector3D(int x, int y, int z)
          Vector3D constructor
 
Method Summary
 int getX()
          Gets the x component.
 int getY()
          Gets the y component.
 int getZ()
          Gets the z component.
 int innerProduct(Vector3D v)
          Calculates inner product.
static int innerProduct(Vector3D v1, Vector3D v2)
          Calculates the inner product of two vectors.
 void outerProduct(Vector3D v)
          Calculates outer product.
static Vector3D outerProduct(Vector3D v1, Vector3D v2)
          Calculates the outer product of two vectors.
 void set(int x, int y, int z)
          Sets a new vector.
 void setX(int x)
          Sets a new x component.
 void setY(int y)
          Sets a new y component.
 void setZ(int z)
          Sets a new z component.
 void unit()
          Performs normalization.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public int x
The x component

y

public int y
The y component

z

public int z
The z component
Constructor Detail

Vector3D

public Vector3D()
Vector3D constructor

Vector3D

public Vector3D(int x,
                int y,
                int z)
Vector3D constructor
Parameters:
x - X component
y - Y component
z - Z component
Method Detail

getX

public int getX()
Gets the x component.
Returns:
int - X component

getY

public int getY()
Gets the y component.
Returns:
int - Y component

getZ

public int getZ()
Gets the z component.
Returns:
int - Z component

setX

public void setX(int x)
Sets a new x component.
Parameters:
x - The new x component

setY

public void setY(int y)
Sets a new y component.
Parameters:
y - The new y component

setZ

public void setZ(int z)
Sets a new z component.
Parameters:
z - The new z component

set

public void set(int x,
                int y,
                int z)
Sets a new vector.
Parameters:
x - The new x component
y - The new y component
z - The new z component

unit

public void unit()
Performs normalization.
Throws:
IllegalArgumentException - if a zero vector.
IllegalStateException - if called during sprite execution.

innerProduct

public int innerProduct(Vector3D v)
Calculates inner product.
Parameters:
v - The vector on which the operation is performed
Returns:
int - Inner product
Throws:
IllegalStateException - if called during sprite execution.

outerProduct

public void outerProduct(Vector3D v)
Calculates outer product. Computes the outer product of a vector with itself, reflecting the result in itself.
Parameters:
v - The vector on which the operation is performed
Returns:
Vector3D
Throws:
IllegalStateException - if called during sprite execution.

innerProduct

public static int innerProduct(Vector3D v1,
                               Vector3D v2)
Calculates the inner product of two vectors. Computes v1Ev2.
Parameters:
v1 - One of the vectors
v2 - The other vector
Returns:
int - Inner product
Throws:
IllegalStateException - if called during sprite execution.

outerProduct

public static Vector3D outerProduct(Vector3D v1,
                                    Vector3D v2)
Calculates the outer product of two vectors. Computes v1~v2.
Parameters:
v1 - One of the vectors
v2 - The other vector
Returns:
Vector3D
Throws:
IllegalStateException - if called during sprite execution.


Copyright 2002,2003 Aplix Corporation. All rights reserved. Aplix Confidential and Restricted.