public class Vec3 extends java.lang.Object implements IData<Vec3>
| Modifier and Type | Field and Description |
|---|---|
static Vec3 |
axisX
Don't modify the value of this vector.
|
static Vec3 |
axisY
Don't modify the value of this vector.
|
static Vec3 |
axisZ
Don't modify the value of this vector.
|
static Vec3 |
maxPoint
Don't modify the value of this vector.
|
static Vec3 |
minPoint
Don't modify the value of this vector.
|
static Vec3 |
minus_one
Don't modify the value of this vector.
|
static Vec3 |
one
Don't modify the value of this vector.
|
float |
x |
float |
y |
float |
z |
static Vec3 |
zero
Don't modify the value of this vector.
|
| Constructor and Description |
|---|
Vec3()
Constructor of the (0, 0, 0) Point
|
Vec3(float x,
float y,
float z)
Constructor of the (x, y, z) Point
|
| Modifier and Type | Method and Description |
|---|---|
Vec3 |
add(float x,
float y,
float z) |
Vec3 |
add(Vec3 vec) |
Vec3 |
add(Vec3 vec1,
Vec3 vec2) |
Vec3 |
addScale(Vec3 vec1,
Vec3 vec2,
float scale) |
Vec3 |
addScale(Vec3 vec1,
Vec3 vec2,
Vec3 scale) |
float |
angle(Vec3 vec) |
float |
angleOriented(Vec3 vec,
Vec3 referenceAxis) |
Vec3 |
clone() |
Vec3 |
cross(Vec3 vec1,
Vec3 vec2)
The cross product of two vectors: (y1*z2-z1*y2, z1*x2-x1*z2, x1*y2-y1*x2)
|
float |
distance(Vec3 vec) |
float |
distanceSqr(Vec3 vec) |
Vec3 |
divide(Vec3 vec,
float f) |
Vec3 |
divide(Vec3 vec1,
Vec3 vec2) |
float |
dot(Vec3 vec) |
boolean |
equals(java.lang.Object obj) |
void |
get(float[] dst) |
float |
get(int i) |
float |
getX() |
float |
getY() |
float |
getZ() |
int |
hashCode() |
Vec3 |
interpolate(Vec3 current,
Vec3 next,
float t)
Interpolate
current and next and store result in this. |
void |
interpolateNoCheck(Vec3 next,
float t,
float[] dest,
int destIndex) |
Vec3 |
interpolateNoCheck(Vec3 current,
Vec3 next,
float t) |
Vec3 |
invert(Vec3 vec) |
boolean |
isUnitVector() |
boolean |
isZeroVector() |
float |
magnitude() |
Vec3 |
magnitude(float length) |
float |
magnitudeSqr() |
Vec3 |
max(Vec3 vec1,
Vec3 vec2) |
Vec3 |
min(Vec3 vec1,
Vec3 vec2) |
Vec3 |
multiply(float f) |
Vec3 |
multiply(Vec3 vec) |
Vec3 |
multiply(Vec3 vec,
float f) |
Vec3 |
multiply(Vec3 vec1,
Vec3 vec2) |
float |
normalize()
Normalize this
Vec3 |
float |
normalize(Vec3 src) |
Vec3 |
project(Vec3 axis,
Vec3 vector)
Project the specified vector on the direction and store the result in this
|
Vec3 |
set(float xyz) |
Vec3 |
set(float[] src) |
Vec3 |
set(float x,
float y,
float z) |
void |
set(int i,
float v) |
Vec3 |
set(Vec3 src)
Copy
src in this vector. |
Vec3 |
set(Vec4 src)
Copy
src in this vector. |
Vec3 |
setUnit() |
Vec3 |
setX(float x) |
Vec3 |
setY(float y) |
Vec3 |
setZ(float z) |
Vec3 |
setZero() |
Vec3 |
subtract(Vec3 vec) |
Vec3 |
subtract(Vec3 vec1,
Vec3 vec2) |
java.lang.String |
toString() |
static Vec3 |
v3() |
public static final Vec3 zero
public static final Vec3 one
public static final Vec3 minus_one
public static final Vec3 axisX
public static final Vec3 axisY
public static final Vec3 axisZ
public static final Vec3 maxPoint
public static final Vec3 minPoint
public float x
public float y
public float z
public Vec3()
public Vec3(float x,
float y,
float z)
public static Vec3 v3()
public final Vec3 clone()
public final boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final java.lang.String toString()
toString in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Objectpublic final boolean isZeroVector()
public final Vec3 setZero()
public final boolean isUnitVector()
public final Vec3 setUnit()
public final float get(int i)
public final void get(float[] dst)
public final void set(int i,
float v)
public Vec3 set(float x, float y, float z)
public Vec3 set(float xyz)
public final float getX()
public final Vec3 setX(float x)
public final float getY()
public final Vec3 setY(float y)
public final float getZ()
public final Vec3 setZ(float z)
public Vec3 add(float x, float y, float z)
public final Vec3 add(Vec3 vec1, Vec3 vec2)
vec1 - vec2 - public final Vec3 addScale(Vec3 vec1, Vec3 vec2, Vec3 scale)
vec1 - vec2 - scale - public final Vec3 addScale(Vec3 vec1, Vec3 vec2, float scale)
vec1 - vec2 - scale - public final Vec3 subtract(Vec3 vec1, Vec3 vec2)
vec1 - vec2 - public final Vec3 multiply(Vec3 vec1, Vec3 vec2)
vec1 - vec2 - public final Vec3 multiply(float f)
vec - f - public final Vec3 multiply(Vec3 vec, float f)
vec - f - public final Vec3 divide(Vec3 vec1, Vec3 vec2)
vec1 - vec2 - public final float magnitude()
Vec3public final float magnitudeSqr()
Vec3public final Vec3 magnitude(float length)
length - new magnitude (length) for this Vec3public final float normalize()
Vec3public final float distance(Vec3 vec)
vector - a vectorpublic final float distanceSqr(Vec3 vec)
vec - a vectorpublic final float dot(Vec3 vec)
vec - a vectorpublic Vec3 project(Vec3 axis, Vec3 vector)
public final Vec3 cross(Vec3 vec1, Vec3 vec2)
vec1 - first vectorvec2 - second vectorpublic final float angle(Vec3 vec)
public final float angleOriented(Vec3 vec, Vec3 referenceAxis)
public final Vec3 interpolate(Vec3 current, Vec3 next, float t)
IInterpolablecurrent and next and store result in this.interpolate in interface IInterpolable<Vec3>interpolate in interface IData<Vec3>next - t - range is [0, 1]current - current valuepublic final void interpolateNoCheck(Vec3 next, float t, float[] dest, int destIndex)
public final Vec3 set(Vec3 src)
src in this vector.set in interface IValueCopy<Vec3>src - source vectorpublic final Vec3 set(float[] src)
Bonzai Engine 1.3.4 11/12/2015 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2015 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com