|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.ucm.look.ar.math.geom.Point2
es.ucm.look.ar.math.geom.Point3
es.ucm.look.ar.math.geom.Vector3
public class Vector3
Represents a 3 dimensions vector
Field Summary |
---|
Fields inherited from class es.ucm.look.ar.math.geom.Point3 |
---|
z |
Fields inherited from class es.ucm.look.ar.math.geom.Point2 |
---|
x, y |
Constructor Summary | |
---|---|
Vector3(float x,
float y,
float z)
Constructs a vector from its 3 coordinates |
|
Vector3(Point3 v)
Constructs a vector from another vector. |
|
Vector3(Point3 p1,
Point3 p2)
Constructs a vector that points from p1 to p2 |
Method Summary | |
---|---|
void |
add(Vector3 v,
boolean normalize)
Adds a vector and then, if normalize is true normalize the vector |
float |
angle(Vector3 v)
Returns the formed angle with the given vector |
Vector3 |
crossProduct(Vector3 v)
Returns the cross product with the given vector |
float |
dotProduct(Vector3 v)
Returns the dot product with the given vector |
int |
getGreatestComponent()
Returns the index from the vector's greatest absolute coordinate |
static Vector3 |
getVolatileVector(float x1,
float y1,
float z1,
float x2,
float y2,
float z2)
|
static Vector3 |
getVolatileVector(Point3 p1,
Point3 p2)
Returns a volatile vector pointing from p1 to p2. |
float |
module()
Returns vector module |
float |
module2()
Returns module's square, avoiding do the square root |
void |
normalize()
Normalize the vector |
static Vector3 |
normalVector(Point3 p1,
Point3 p2,
Point3 p3)
Returns the normal vector to the plane formed by the 3 given points |
void |
preMultiply(float[] m)
Premultiply the vector with a matrix |
void |
rotateX(float rotX)
Rotate the vector around x-axis |
void |
rotateY(float angle)
Rotate the vector around y-axis |
void |
rotateZ(float rotZ)
Rotate the vector around z-axis |
void |
scale(float k)
Scales the vector |
void |
set(float x,
float y,
float z)
Sets point coordinates |
void |
set(float x1,
float y1,
float z1,
float x2,
float y2,
float z2)
Creates the vector form point defined by (x1, y1, z1) to point defined by (x2, y2, z2) |
void |
set(Point3 p1,
Point3 p2)
Creates a vector from point p1 to point p2 |
Methods inherited from class es.ucm.look.ar.math.geom.Point3 |
---|
add, add, array, getCoordinatesArray, getVolatilePoint, inverseScale, scale, set, set, subtract, toString |
Methods inherited from class es.ucm.look.ar.math.geom.Point2 |
---|
add, add |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Vector3(float x, float y, float z)
x
- x coordinatey
- y coordinatez
- z coordinatepublic Vector3(Point3 v)
v
- public Vector3(Point3 p1, Point3 p2)
p1
- Starting point for the vectorp2
- Finish point for the vectorMethod Detail |
---|
public void add(Vector3 v, boolean normalize)
v
- the vector to be addednormalize
- if the vector must be normalized after the additionpublic float angle(Vector3 v)
v
- the vector
public Vector3 crossProduct(Vector3 v)
v
- the vector
public float dotProduct(Vector3 v)
v
- the vector
public int getGreatestComponent()
public static Vector3 getVolatileVector(float x1, float y1, float z1, float x2, float y2, float z2)
public static Vector3 getVolatileVector(Point3 p1, Point3 p2)
public float module()
public float module2()
public void normalize()
public static Vector3 normalVector(Point3 p1, Point3 p2, Point3 p3)
p1
- point 1p2
- point 2p3
- point 3
public void preMultiply(float[] m)
m
- the matrixpublic void rotateX(float rotX)
rotX
- rotation in radianspublic void rotateY(float angle)
rotY
- rotation in radianspublic void rotateZ(float rotZ)
rotZ
- rotation in radianspublic void scale(float k)
k
- scale factorpublic void set(float x, float y, float z)
Point3
set
in class Point3
x
- x coordinatey
- y coordinatez
- z coordinatepublic void set(float x1, float y1, float z1, float x2, float y2, float z2)
x1
- y1
- z1
- x2
- y2
- z2
- public void set(Point3 p1, Point3 p2)
p1
- start pointp2
- end point
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |