|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
3D Vector based upon three float components. More...
Public Member Functions | |
| Vec3f () | |
| Vec3f (final Vec3f o) | |
| Vec3f (final Vec4f o) | |
| Creating new Vec3f using Vec4f, dropping w. More... | |
| Vec3f (final Vec2f o, final float z) | |
| Creating new Vec3f using { Vec2f, z}. More... | |
| Vec3f | copy () |
| Vec3f (final float[] xyz) | |
| Vec3f (final float x, final float y, final float z) | |
| Vec3f | set (final Vec3f o) |
| this = o, returns this. More... | |
| Vec3f | set (final Vec2f o, final float z) |
| this = { o, z }, returns this. More... | |
| Vec3f | set (final Vec4f o) |
| this = o while dropping w, returns this. More... | |
| Vec3f | set (final float x, final float y, final float z) |
| this = { x, y, z }, returns this. More... | |
| Vec3f | set (final float[] xyz) |
| this = xyz, returns this. More... | |
| Vec3f | toArray (final float[] xyz) |
| xyz[0..2] = this. More... | |
| void | set (final int i, final float val) |
| Sets the ith component, 0 <= i < 3. More... | |
| float[] | get (final float[] xyz) |
| xyz = this, returns xyz. More... | |
| float | get (final int i) |
| Gets the ith component, 0 <= i < 3. More... | |
| float | x () |
| float | y () |
| float | z () |
| void | setX (final float x) |
| void | setY (final float y) |
| void | setZ (final float z) |
| Vec3f | max (final Vec3f m) |
| this = max(this, m), returns this. More... | |
| Vec3f | min (final Vec3f m) |
| this = min(this, m), returns this. More... | |
| Vec3f | mul (final float val) |
| Returns this * val; creates new vector. More... | |
| Vec3f | mul (final Vec3f a, final Vec3f b) |
| this = a * b, returns this. More... | |
| Vec3f | mul (final Vec3f s) |
| this = this * s, returns this. More... | |
| Vec3f | mul (final float sx, final float sy, final float sz) |
| this = this * { sx, sy, sz }, returns this. More... | |
| Vec3f | div (final Vec3f a, final Vec3f b) |
| this = a / b, returns this. More... | |
| Vec3f | div (final Vec3f a) |
| this = this / a, returns this. More... | |
| Vec3f | scale (final float s) |
| this = this * s, returns this. More... | |
| Vec3f | plus (final Vec3f arg) |
| Returns this + arg; creates new vector. More... | |
| Vec3f | plus (final Vec3f a, final Vec3f b) |
| this = a + b, returns this. More... | |
| Vec3f | add (final float dx, final float dy, final float dz) |
| this = this + { dx, dy, dz }, returns this. More... | |
| Vec3f | add (final Vec3f b) |
| this = this + b, returns this. More... | |
| Vec3f | minus (final Vec3f arg) |
| Returns this - arg; creates new vector. More... | |
| Vec3f | minus (final Vec3f a, final Vec3f b) |
| this = a - b, returns this. More... | |
| Vec3f | sub (final Vec3f b) |
| this = this - b, returns this. More... | |
| boolean | isZero () |
| Return true if all components are zero, i.e. More... | |
| float | length () |
| Return the length of this vector, a.k.a the norm or magnitude More... | |
| float | lengthSq () |
| Return the squared length of this vector, a.k.a the squared norm or squared magnitude More... | |
| Vec3f | normalize () |
| Normalize this vector in place. More... | |
| float | distSq (final Vec3f o) |
| Return the squared distance between this vector and the given one. More... | |
| float | dist (final Vec3f o) |
| Return the distance between this vector and the given one. More... | |
| float | dot (final Vec3f o) |
| Return the dot product of this vector and the given one. More... | |
| Vec3f | cross (final Vec3f arg) |
| Returns this cross arg; creates new vector. More... | |
| Vec3f | cross (final Vec3f a, final Vec3f b) |
| this = a cross b. More... | |
| float | cosAngle (final Vec3f o) |
Return the cosine of the angle between two vectors using dot(Vec3f). More... | |
| float | angle (final Vec3f o) |
Return the angle between two vectors in radians using Math#acos(double) on cosAngle(Vec3f). More... | |
| boolean | isEqual (final Vec3f o, final float epsilon) |
Equals check using a given FloatUtil#EPSILON value and FloatUtil#isEqual(float, float, float). More... | |
| boolean | isEqual (final Vec3f o) |
Equals check using FloatUtil#EPSILON in FloatUtil#isEqual(float, float). More... | |
| boolean | equals (final Object o) |
| String | toString () |
Static Public Attributes | |
| static final Vec3f | ONE = new Vec3f(1f, 1f, 1f) |
| static final Vec3f | UNIT_X = new Vec3f(1f, 0f, 0f) |
| static final Vec3f | UNIT_X_NEG = new Vec3f(-1f, 0f, 0f) |
| static final Vec3f | UNIT_Y = new Vec3f(0f, 1f, 0f) |
| static final Vec3f | UNIT_Y_NEG = new Vec3f(0f, -1f, 0f) |
| static final Vec3f | UNIT_Z = new Vec3f(0f, 0f, 1f) |
| static final Vec3f | UNIT_Z_NEG = new Vec3f(0f, 0f, -1f) |
3D Vector based upon three float components.
Implementation borrowed from gfxbox2 and its data layout from JOAL's Vec3f.
Definition at line 37 of file Vec3f.java.
| com.jogamp.math.Vec3f.Vec3f | ( | ) |
| com.jogamp.math.Vec3f.Vec3f | ( | final Vec3f | o | ) |
Definition at line 52 of file Vec3f.java.
| com.jogamp.math.Vec3f.Vec3f | ( | final Vec4f | o | ) |
Creating new Vec3f using Vec4f, dropping w.
Definition at line 57 of file Vec3f.java.
| com.jogamp.math.Vec3f.Vec3f | ( | final Vec2f | o, |
| final float | z | ||
| ) |
Creating new Vec3f using { Vec2f, z}.
Definition at line 62 of file Vec3f.java.
| com.jogamp.math.Vec3f.Vec3f | ( | final float[] | xyz | ) |
Definition at line 70 of file Vec3f.java.
| com.jogamp.math.Vec3f.Vec3f | ( | final float | x, |
| final float | y, | ||
| final float | z | ||
| ) |
Definition at line 74 of file Vec3f.java.
| Vec3f com.jogamp.math.Vec3f.add | ( | final float | dx, |
| final float | dy, | ||
| final float | dz | ||
| ) |
this = this + { dx, dy, dz }, returns this.
Definition at line 239 of file Vec3f.java.
this = this + b, returns this.
Definition at line 247 of file Vec3f.java.
| float com.jogamp.math.Vec3f.angle | ( | final Vec3f | o | ) |
Return the angle between two vectors in radians using Math#acos(double) on cosAngle(Vec3f).
Definition at line 366 of file Vec3f.java.
| Vec3f com.jogamp.math.Vec3f.copy | ( | ) |
Definition at line 66 of file Vec3f.java.
| float com.jogamp.math.Vec3f.cosAngle | ( | final Vec3f | o | ) |
Return the cosine of the angle between two vectors using dot(Vec3f).
Definition at line 359 of file Vec3f.java.
this = a cross b.
NOTE: "this" must be a different vector than both a and b.
Definition at line 349 of file Vec3f.java.
Returns this cross arg; creates new vector.
Definition at line 343 of file Vec3f.java.
| float com.jogamp.math.Vec3f.dist | ( | final Vec3f | o | ) |
Return the distance between this vector and the given one.
Definition at line 329 of file Vec3f.java.
| float com.jogamp.math.Vec3f.distSq | ( | final Vec3f | o | ) |
Return the squared distance between this vector and the given one.
When comparing the relative distance between two points it is usually sufficient to compare the squared distances, thus avoiding an expensive square root operation.
Definition at line 319 of file Vec3f.java.
this = this / a, returns this.
Definition at line 210 of file Vec3f.java.
this = a / b, returns this.
Definition at line 202 of file Vec3f.java.
| float com.jogamp.math.Vec3f.dot | ( | final Vec3f | o | ) |
Return the dot product of this vector and the given one.
Definition at line 338 of file Vec3f.java.
| boolean com.jogamp.math.Vec3f.equals | ( | final Object | o | ) |
Definition at line 416 of file Vec3f.java.
| float[] com.jogamp.math.Vec3f.get | ( | final float[] | xyz | ) |
xyz = this, returns xyz.
Definition at line 137 of file Vec3f.java.
| float com.jogamp.math.Vec3f.get | ( | final int | i | ) |
Gets the ith component, 0 <= i < 3.
Definition at line 145 of file Vec3f.java.
| boolean com.jogamp.math.Vec3f.isEqual | ( | final Vec3f | o | ) |
Equals check using FloatUtil#EPSILON in FloatUtil#isEqual(float, float).
Implementation considers following corner cases:
| o | comparison value |
FloatUtil#EPSILON, otherwise false. Definition at line 405 of file Vec3f.java.
| boolean com.jogamp.math.Vec3f.isEqual | ( | final Vec3f | o, |
| final float | epsilon | ||
| ) |
Equals check using a given FloatUtil#EPSILON value and FloatUtil#isEqual(float, float, float).
Implementation considers following corner cases:
| o | comparison value |
| epsilon | consider using FloatUtil#EPSILON |
epsilon, otherwise false. Definition at line 383 of file Vec3f.java.
| boolean com.jogamp.math.Vec3f.isZero | ( | ) |
Return true if all components are zero, i.e.
it's absolute value < EPSILON.
Definition at line 276 of file Vec3f.java.
| float com.jogamp.math.Vec3f.length | ( | ) |
Return the length of this vector, a.k.a the norm or magnitude
Definition at line 283 of file Vec3f.java.
| float com.jogamp.math.Vec3f.lengthSq | ( | ) |
Return the squared length of this vector, a.k.a the squared norm or squared magnitude
Definition at line 290 of file Vec3f.java.
this = max(this, m), returns this.
Definition at line 163 of file Vec3f.java.
this = min(this, m), returns this.
Definition at line 170 of file Vec3f.java.
this = a - b, returns this.
Definition at line 260 of file Vec3f.java.
Returns this - arg; creates new vector.
Definition at line 255 of file Vec3f.java.
| Vec3f com.jogamp.math.Vec3f.mul | ( | final float | sx, |
| final float | sy, | ||
| final float | sz | ||
| ) |
this = this * { sx, sy, sz }, returns this.
Definition at line 194 of file Vec3f.java.
| Vec3f com.jogamp.math.Vec3f.mul | ( | final float | val | ) |
Returns this * val; creates new vector.
Definition at line 178 of file Vec3f.java.
this = a * b, returns this.
Definition at line 183 of file Vec3f.java.
this = this * s, returns this.
Definition at line 191 of file Vec3f.java.
| Vec3f com.jogamp.math.Vec3f.normalize | ( | ) |
Normalize this vector in place.
Definition at line 297 of file Vec3f.java.
this = a + b, returns this.
Definition at line 231 of file Vec3f.java.
Returns this + arg; creates new vector.
Definition at line 226 of file Vec3f.java.
| Vec3f com.jogamp.math.Vec3f.scale | ( | final float | s | ) |
this = this * s, returns this.
Definition at line 218 of file Vec3f.java.
| Vec3f com.jogamp.math.Vec3f.set | ( | final float | x, |
| final float | y, | ||
| final float | z | ||
| ) |
this = { x, y, z }, returns this.
Definition at line 103 of file Vec3f.java.
| Vec3f com.jogamp.math.Vec3f.set | ( | final float[] | xyz | ) |
this = xyz, returns this.
Definition at line 111 of file Vec3f.java.
| void com.jogamp.math.Vec3f.set | ( | final int | i, |
| final float | val | ||
| ) |
Sets the ith component, 0 <= i < 3.
Definition at line 127 of file Vec3f.java.
this = { o, z }, returns this.
Definition at line 87 of file Vec3f.java.
this = o, returns this.
Definition at line 79 of file Vec3f.java.
this = o while dropping w, returns this.
Definition at line 95 of file Vec3f.java.
| void com.jogamp.math.Vec3f.setX | ( | final float | x | ) |
| void com.jogamp.math.Vec3f.setY | ( | final float | y | ) |
| void com.jogamp.math.Vec3f.setZ | ( | final float | z | ) |
this = this - b, returns this.
Definition at line 268 of file Vec3f.java.
| Vec3f com.jogamp.math.Vec3f.toArray | ( | final float[] | xyz | ) |
| String com.jogamp.math.Vec3f.toString | ( | ) |
Definition at line 425 of file Vec3f.java.
| float com.jogamp.math.Vec3f.x | ( | ) |
Definition at line 154 of file Vec3f.java.
| float com.jogamp.math.Vec3f.y | ( | ) |
Definition at line 155 of file Vec3f.java.
| float com.jogamp.math.Vec3f.z | ( | ) |
Definition at line 156 of file Vec3f.java.
Definition at line 38 of file Vec3f.java.
Definition at line 39 of file Vec3f.java.
Definition at line 40 of file Vec3f.java.
Definition at line 41 of file Vec3f.java.
Definition at line 42 of file Vec3f.java.
Definition at line 43 of file Vec3f.java.
Definition at line 44 of file Vec3f.java.