public class Vec3 extends java.lang.Object implements IData<Vec3>
| Modifier and Type | Field and Description |
|---|---|
static Vec3 |
AXIS_NEG_X
Don't modify the value.
|
static Vec3 |
AXIS_NEG_Y
Don't modify the value.
|
static Vec3 |
AXIS_NEG_Z
Don't modify the value.
|
static Vec3 |
AXIS_X
Don't modify the value.
|
static Vec3 |
AXIS_Y
Don't modify the value.
|
static Vec3 |
AXIS_Z
Don't modify the value.
|
static Vec3 |
MAX_VALUE
Don't modify the value.
|
static Vec3 |
MIN_VALUE
Don't modify the value.
|
static Vec3 |
MINUS_ONE
Don't modify the value.
|
static Vec3 |
ONE
Don't modify the value.
|
static Vec3 |
PLANE_XY
Don't modify the value.
|
static Vec3 |
PLANE_XZ
Don't modify the value.
|
static Vec3 |
PLANE_YZ
Don't modify the value.
|
float |
x |
float |
y |
float |
z |
static Vec3 |
ZERO
Don't modify the value.
|
| 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) |
float[] |
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) |
Vec3 |
normal(Vec3 dir1,
Vec3 dir2) |
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() |
Vec3 |
triangleNormal(Vec3 v0,
Vec3 v1,
Vec3 v2) |
public static final Vec3 ZERO
public static final Vec3 ONE
public static final Vec3 MINUS_ONE
public static final Vec3 AXIS_X
public static final Vec3 AXIS_Y
public static final Vec3 AXIS_Z
public static final Vec3 AXIS_NEG_X
public static final Vec3 AXIS_NEG_Y
public static final Vec3 AXIS_NEG_Z
public static final Vec3 MAX_VALUE
public static final Vec3 MIN_VALUE
public static final Vec3 PLANE_XY
public static final Vec3 PLANE_XZ
public static final Vec3 PLANE_YZ
public float x
public float y
public float z
public Vec3()
public Vec3(float x,
float y,
float z)
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 float[] 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)
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)
vec - 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 Vec3 triangleNormal(Vec3 v0, Vec3 v1, Vec3 v2)
v0 - first pointv1 - second pointv2 - third pointpublic final Vec3 normal(Vec3 dir1, Vec3 dir2)
dir1 - first directiondir2 - second directionpublic 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.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com