Package org.sunflow.math
Class Vector3
- java.lang.Object
-
- org.sunflow.math.Vector3
-
public final class Vector3 extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Vector3
add(Vector3 v1, Vector3 v2, Vector3 dest)
static Vector3
cross(Vector3 v1, Vector3 v2, Vector3 dest)
static Vector3
decode(short n)
static Vector3
decode(short n, Vector3 dest)
Vector3
div(float d)
Vector3
div(float d, Vector3 dest)
float
dot(float vx, float vy, float vz)
static float
dot(Vector3 v1, Vector3 v2)
short
encode()
float
get(int i)
float
length()
float
lengthSquared()
Vector3
mul(float s)
Vector3
mul(float s, Vector3 dest)
Vector3
negate()
Vector3
negate(Vector3 dest)
Vector3
normalize()
Vector3
normalize(Vector3 dest)
float
normalizeLength()
Vector3
set(float x, float y, float z)
Vector3
set(Vector3 v)
static Vector3
sub(Vector3 v1, Vector3 v2, Vector3 dest)
java.lang.String
toString()
-
-
-
Constructor Detail
-
Vector3
public Vector3()
-
Vector3
public Vector3(float x, float y, float z)
-
Vector3
public Vector3(Vector3 v)
-
-
Method Detail
-
decode
public static final Vector3 decode(short n)
-
encode
public final short encode()
-
get
public float get(int i)
-
length
public final float length()
-
lengthSquared
public final float lengthSquared()
-
negate
public final Vector3 negate()
-
mul
public final Vector3 mul(float s)
-
div
public final Vector3 div(float d)
-
normalizeLength
public final float normalizeLength()
-
normalize
public final Vector3 normalize()
-
set
public final Vector3 set(float x, float y, float z)
-
dot
public final float dot(float vx, float vy, float vz)
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-