|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ReadonlyVec3D
Readonly, immutable interface wrapper for Vec3D instances. Used throughout the library for safety purposes.
Method Summary | |
---|---|
Vec3D |
add(float a,
float b,
float c)
Adds vector {a,b,c} and returns result as new vector. |
Vec3D |
add(ReadonlyVec3D v)
|
Vec3D |
add(Vec3D v)
Add vector v and returns result as new vector. |
float |
angleBetween(ReadonlyVec3D v)
Computes the angle between this vector and vector V. |
float |
angleBetween(ReadonlyVec3D v,
boolean forceNormalize)
Computes the angle between this vector and vector V. |
int |
compareTo(ReadonlyVec3D v)
Compares the length of the vector with another one. |
Vec3D |
copy()
Copy. |
Vec3D |
cross(ReadonlyVec3D v)
Calculates cross-product with vector v. |
Vec3D |
crossInto(ReadonlyVec3D v,
Vec3D result)
Calculates cross-product with vector v. |
float |
distanceTo(ReadonlyVec3D v)
Calculates distance to another vector. |
float |
distanceToSquared(ReadonlyVec3D v)
Calculates the squared distance to another vector. |
float |
dot(ReadonlyVec3D v)
Computes the scalar product (dot product) with the given vector. |
boolean |
equals(java.lang.Object obj)
|
boolean |
equalsWithTolerance(ReadonlyVec3D v,
float tolerance)
Compares this vector with the one given. |
Vec3D |
getAbs()
Gets the abs. |
float |
getComponent(int id)
|
float |
getComponent(Vec3D.Axis id)
|
Vec3D |
getConstrained(AABB box)
Creates a copy of the vector which forcefully fits in the given AABB. |
Vec3D |
getFloored()
Creates a new vector whose components are the integer value of their current values. |
Vec3D |
getFrac()
Creates a new vector whose components are the fractional part of their current values. |
Vec3D |
getInverted()
Scales vector uniformly by factor -1 ( v = -v ). |
Vec3D |
getLimited(float lim)
Creates a copy of the vector with its magnitude limited to the length given. |
Vec3D |
getNormalized()
Produces the normalized version as a new vector. |
Vec3D |
getNormalizedTo(float len)
Produces a new vector normalized to the given length. |
Vec3D |
getReciprocal()
Returns a multiplicative inverse copy of the vector. |
Vec3D |
getReflected(ReadonlyVec3D normal)
|
Vec3D |
getRotatedAroundAxis(ReadonlyVec3D axis,
float theta)
Gets the rotated around axis. |
Vec3D |
getRotatedX(float theta)
Creates a new vector rotated by the given angle around the X axis. |
Vec3D |
getRotatedY(float theta)
Creates a new vector rotated by the given angle around the Y axis. |
Vec3D |
getRotatedZ(float theta)
Creates a new vector rotated by the given angle around the Z axis. |
Vec3D |
getSignum()
Creates a new vector in which all components are replaced with the signum of their original values. |
float |
headingXY()
Computes the vector's direction in the XY plane (for example for 2D points). |
float |
headingXZ()
Computes the vector's direction in the XZ plane. |
float |
headingYZ()
Computes the vector's direction in the YZ plane. |
Vec3D |
interpolateTo(ReadonlyVec3D v,
float f)
Interpolates the vector towards the given target vector, using linear interpolation. |
Vec3D |
interpolateTo(ReadonlyVec3D v,
float f,
InterpolateStrategy s)
Interpolates the vector towards the given target vector, using the given InterpolateStrategy . |
boolean |
isInAABB(AABB box)
Checks if the point is inside the given AABB. |
boolean |
isInAABB(Vec3D boxOrigin,
Vec3D boxExtent)
Checks if the point is inside the given axis-aligned bounding box. |
boolean |
isMajorAxis(float tolerance)
Checks if the vector is parallel with either the X or Y axis (any direction). |
boolean |
isZeroVector()
Checks if vector has a magnitude equals or close to zero (tolerance used is MathUtils.EPS ). |
float |
magnitude()
Calculates the magnitude/eucledian length of the vector. |
float |
magSquared()
Calculates only the squared magnitude/length of the vector. |
Vec3D |
scale(float s)
Scales vector uniformly and returns result as new vector. |
Vec3D |
scale(float a,
float b,
float c)
Scales vector non-uniformly and returns result as new vector. |
Vec3D |
scale(ReadonlyVec3D s)
Scales vector non-uniformly by vector v and returns result as new vector. |
Vec3D |
sub(float a,
float b,
float c)
Subtracts vector {a,b,c} and returns result as new vector. |
Vec3D |
sub(ReadonlyVec3D v)
Subtracts vector v and returns result as new vector. |
Vec2D |
to2DXY()
Creates a new 2D vector of the XY components. |
Vec2D |
to2DXZ()
Creates a new 2D vector of the XZ components. |
Vec2D |
to2DYZ()
Creates a new 2D vector of the YZ components. |
float[] |
toArray()
|
Vec3D |
toCartesian()
Converts the spherical vector back into cartesian coordinates. |
Vec3D |
toSpherical()
Converts the vector into spherical coordinates. |
float |
x()
|
float |
y()
|
float |
z()
|
Method Detail |
---|
Vec3D add(float a, float b, float c)
a
- X coordinateb
- Y coordinatec
- Z coordinate
Vec3D add(ReadonlyVec3D v)
Vec3D add(Vec3D v)
v
- vector to add
float angleBetween(ReadonlyVec3D v)
angleBetween(ReadonlyVec3D, boolean)
v
- vector
float angleBetween(ReadonlyVec3D v, boolean forceNormalize)
v
- vectorforceNormalize
- true, if normalized versions of the vectors are to be used
(Note: only copies will be used, original vectors will not be
altered by this method)
int compareTo(ReadonlyVec3D v)
v
- vector to compare with
Vec3D copy()
Vec3D cross(ReadonlyVec3D v)
v
- vector to cross
Vec3D crossInto(ReadonlyVec3D v, Vec3D result)
v
- vector to crossresult
- result vector
float distanceTo(ReadonlyVec3D v)
v
- non-null vector
float distanceToSquared(ReadonlyVec3D v)
v
- non-null vector
magSquared()
float dot(ReadonlyVec3D v)
v
- the v
boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
boolean equalsWithTolerance(ReadonlyVec3D v, float tolerance)
v
- the vtolerance
- the tolerance
Vec3D getAbs()
float getComponent(Vec3D.Axis id)
float getComponent(int id)
Vec3D getConstrained(AABB box)
box
- the box
Vec3D getFloored()
Vec3D getFrac()
Vec3D getInverted()
Vec3D getLimited(float lim)
lim
- new maximum magnitude
Vec3D getNormalized()
Vec3D getNormalizedTo(float len)
len
- new desired length
Vec3D getReciprocal()
Vec3D getReflected(ReadonlyVec3D normal)
Vec3D getRotatedAroundAxis(ReadonlyVec3D axis, float theta)
axis
- the axistheta
- the theta
Vec3D getRotatedX(float theta)
theta
- the theta
Vec3D getRotatedY(float theta)
theta
- the theta
Vec3D getRotatedZ(float theta)
theta
- the theta
Vec3D getSignum()
float headingXY()
float headingXZ()
float headingYZ()
Vec3D interpolateTo(ReadonlyVec3D v, float f)
v
- target vectorf
- interpolation factor (should be in the range 0..1)
Vec3D interpolateTo(ReadonlyVec3D v, float f, InterpolateStrategy s)
InterpolateStrategy
.
v
- target vectorf
- interpolation factor (should be in the range 0..1)s
- InterpolateStrategy instance
boolean isInAABB(AABB box)
box
- bounding box to check
boolean isInAABB(Vec3D boxOrigin, Vec3D boxExtent)
boxOrigin
- bounding box origin/centerboxExtent
- bounding box extends (half measure)
boolean isMajorAxis(float tolerance)
tolerance
-
boolean isZeroVector()
MathUtils.EPS
).
float magnitude()
float magSquared()
Vec3D scale(float s)
s
- scale factor
Vec3D scale(float a, float b, float c)
a
- scale factor for X coordinateb
- scale factor for Y coordinatec
- scale factor for Z coordinate
Vec3D scale(ReadonlyVec3D s)
s
- scale vector
Vec3D sub(float a, float b, float c)
a
- X coordinateb
- Y coordinatec
- Z coordinate
Vec3D sub(ReadonlyVec3D v)
v
- vector to be subtracted
Vec2D to2DXY()
Vec2D to2DXZ()
Vec2D to2DYZ()
float[] toArray()
Vec3D toCartesian()
Vec3D toSpherical()
float x()
float y()
float z()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |