|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object glmodel.GL_Vector
public class GL_Vector
A 3D vector, with functions to perform common vector math operations.
Field Summary | |
---|---|
float |
x
|
float |
y
|
float |
z
|
Constructor Summary | |
---|---|
GL_Vector()
Create a 0,0,0 vector |
|
GL_Vector(float[] float3)
Create a vector from the given float[3] xyz values |
|
GL_Vector(float xpos,
float ypos,
float zpos)
Create a vector with the given xyz values |
|
GL_Vector(GL_Vector v)
Create a vector that duplicates the given vector |
|
GL_Vector(GL_Vector point1,
GL_Vector point2)
Create a vector from point1 to point2 |
Method Summary | |
---|---|
GL_Vector |
add(float n)
Add a value to this vector |
GL_Vector |
add(GL_Vector v)
Add a vector to this vector |
static GL_Vector |
add(GL_Vector a,
GL_Vector b)
Return a+b as a new vector |
static float |
angle(GL_Vector a,
GL_Vector b)
returns the angle between 2 vectors |
static float |
angleXY(GL_Vector a,
GL_Vector b)
returns the angle between 2 vectors on the XY plane. |
static float |
angleXZ(GL_Vector a,
GL_Vector b)
returns the angle between 2 vectors on the XZ plane. |
static GL_Vector |
crossProduct(GL_Vector a,
GL_Vector b)
Return the cross product of the two vectors, as a new vector. |
GL_Vector |
div(float n)
Divide vector by a value |
GL_Vector |
div(GL_Vector v)
Divide this vector by another vector |
static GL_Vector |
div(GL_Vector a,
GL_Vector b)
Return a/b as a new vector |
static float |
dotProduct(GL_Vector u,
GL_Vector v)
return the dot product of two vectors |
boolean |
equals(GL_Vector v)
Return true if this vector has the same xyz values as the argument vector |
GL_Vector |
getClone()
Return a copy of the vector |
static GL_Vector |
getNormal(GL_Vector a,
GL_Vector b)
returns the normal vector of the plane defined by the a and b vectors |
static GL_Vector |
getNormal(GL_Vector a,
GL_Vector b,
GL_Vector c)
returns the normal vector from the three vectors |
float |
length()
Return the length of the vector. |
static float |
length(GL_Vector a)
Return the length of the given vector |
GL_Vector |
mult(float n)
Multiply vector by a value |
GL_Vector |
mult(GL_Vector v)
Multiply this vector by another vector |
static GL_Vector |
mult(GL_Vector a,
GL_Vector b)
Return a*b as a new vector |
static GL_Vector |
multiply(GL_Vector v,
float r)
Return the given vector multiplied by the given numeric value, as a new vector |
GL_Vector |
normalize()
Normalize the vector (make its length 0). |
static GL_Vector |
normalize(GL_Vector v)
Return the normalized vector as a new vector |
GL_Vector |
reverse()
Reverse the vector |
static GL_Vector |
rotationVector(float degrees)
return a vector rotated the given number of degrees around the Y axis |
static GL_Vector |
scale(GL_Vector a,
float f)
Return a new vector scaled by the given factor |
GL_Vector |
sub(float n)
Subtract a value from this vector |
GL_Vector |
sub(GL_Vector v)
Subtract vector from this vector |
static GL_Vector |
sub(GL_Vector a,
GL_Vector b)
Return a-b as a new vector |
java.lang.String |
toString()
Return a string representation of the vector |
static GL_Vector |
vectorProduct(GL_Vector a,
GL_Vector b)
returns a x b |
static GL_Vector |
vectorProduct(GL_Vector a,
GL_Vector b,
GL_Vector c)
returns (b-a) x (c-a) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public float x
public float y
public float z
Constructor Detail |
---|
public GL_Vector()
public GL_Vector(float xpos, float ypos, float zpos)
public GL_Vector(float[] float3)
public GL_Vector(GL_Vector v)
public GL_Vector(GL_Vector point1, GL_Vector point2)
Method Detail |
---|
public GL_Vector add(GL_Vector v)
public GL_Vector sub(GL_Vector v)
public GL_Vector mult(GL_Vector v)
public GL_Vector div(GL_Vector v)
public GL_Vector add(float n)
public GL_Vector sub(float n)
public GL_Vector mult(float n)
public GL_Vector div(float n)
public GL_Vector normalize()
public GL_Vector reverse()
public float length()
public java.lang.String toString()
toString
in class java.lang.Object
public GL_Vector getClone()
public boolean equals(GL_Vector v)
public static GL_Vector add(GL_Vector a, GL_Vector b)
public static GL_Vector sub(GL_Vector a, GL_Vector b)
public static GL_Vector mult(GL_Vector a, GL_Vector b)
public static GL_Vector div(GL_Vector a, GL_Vector b)
public static GL_Vector multiply(GL_Vector v, float r)
public static GL_Vector scale(GL_Vector a, float f)
public static float length(GL_Vector a)
public static float dotProduct(GL_Vector u, GL_Vector v)
public static GL_Vector normalize(GL_Vector v)
public static GL_Vector crossProduct(GL_Vector a, GL_Vector b)
public static GL_Vector getNormal(GL_Vector a, GL_Vector b)
public static GL_Vector getNormal(GL_Vector a, GL_Vector b, GL_Vector c)
public static GL_Vector vectorProduct(GL_Vector a, GL_Vector b)
public static GL_Vector vectorProduct(GL_Vector a, GL_Vector b, GL_Vector c)
public static float angle(GL_Vector a, GL_Vector b)
public static float angleXZ(GL_Vector a, GL_Vector b)
public static float angleXY(GL_Vector a, GL_Vector b)
public static GL_Vector rotationVector(float degrees)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |