|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
4D Vector based upon four float components. More...
Public Member Functions | |
| Vec4f () | |
| Vec4f (final Vec4f o) | |
| Vec4f (final Vec3f o, final float w) | |
| Creating new Vec4f using { o, w }. More... | |
| Vec4f | copy () |
| Vec4f (final float[] xyzw) | |
| Vec4f (final float x, final float y, final float z, final float w) | |
| Vec4f | set (final Vec4f o) |
| this = o, returns this. More... | |
| Vec4f | set (final Vec3f o, final float w) |
| this = { o, w }, returns this. More... | |
| Vec4f | set (final float x, final float y, final float z, final float w) |
| this = { x, y, z, w }, returns this. More... | |
| Vec4f | set (final float[] xyzw) |
| this = xyzw, returns this. More... | |
| Vec4f | toArray (final float[] xyzw) |
| xyzw[0..3] = this. More... | |
| void | set (final int i, final float val) |
| Sets the ith component, 0 <= i < 4. More... | |
| float[] | get (final float[] xyzw) |
| xyzw = this, returns xyzw. More... | |
| float | get (final int i) |
| Gets the ith component, 0 <= i < 4. More... | |
| float | x () |
| float | y () |
| float | z () |
| float | w () |
| void | setX (final float x) |
| void | setY (final float y) |
| void | setZ (final float z) |
| void | setW (final float w) |
| Vec4f | max (final Vec4f m) |
| this = max(this, m), returns this. More... | |
| Vec4f | min (final Vec4f m) |
| this = min(this, m), returns this. More... | |
| Vec4f | mul (final float val) |
| Returns this * val; creates new vector. More... | |
| Vec4f | mul (final Vec4f a, final Vec4f b) |
| this = a * b, returns this. More... | |
| Vec4f | mul (final Vec4f s) |
| this = this * s, returns this. More... | |
| Vec4f | mul (final float sx, final float sy, final float sz, final float sw) |
| this = this * { sx, sy, sz, sw }, returns this. More... | |
| Vec4f | div (final Vec4f a, final Vec4f b) |
| this = a / b, returns this. More... | |
| Vec4f | div (final Vec4f a) |
| this = this / a, returns this. More... | |
| Vec4f | scale (final float s) |
| this = this * s, returns this. More... | |
| Vec4f | plus (final Vec4f arg) |
| Returns this + arg; creates new vector. More... | |
| Vec4f | plus (final Vec4f a, final Vec4f b) |
| this = a + b, returns this. More... | |
| Vec4f | add (final float dx, final float dy, final float dz, final float dw) |
| this = this + { dx, dy, dz, dw }, returns this. More... | |
| Vec4f | add (final Vec4f b) |
| this = this + b, returns this. More... | |
| Vec4f | minus (final Vec4f arg) |
| Returns this - arg; creates new vector. More... | |
| Vec4f | minus (final Vec4f a, final Vec4f b) |
| this = a - b, returns this. More... | |
| Vec4f | sub (final Vec4f 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... | |
| Vec4f | normalize () |
| Normalize this vector in place. More... | |
| float | distSq (final Vec4f o) |
| Return the squared distance between this vector and the given one. More... | |
| float | dist (final Vec4f o) |
| Return the distance between this vector and the given one. More... | |
| float | dot (final Vec4f o) |
| Return the dot product of this vector and the given one. More... | |
| float | cosAngle (final Vec4f o) |
| Return the cosines of the angle between two vectors. More... | |
| float | angle (final Vec4f o) |
| Return the angle between two vectors in radians. More... | |
| boolean | isEqual (final Vec4f o, final float epsilon) |
Equals check using a given FloatUtil#EPSILON value and FloatUtil#isEqual(float, float, float). More... | |
| boolean | isEqual (final Vec4f o) |
Equals check using FloatUtil#EPSILON in FloatUtil#isEqual(float, float). More... | |
| boolean | equals (final Object o) |
| String | toString () |
4D Vector based upon four float components.
Implementation borrowed from gfxbox2 and its data layout from JOAL's Vec3f.
Definition at line 37 of file Vec4f.java.
| com.jogamp.math.Vec4f.Vec4f | ( | ) |
| com.jogamp.math.Vec4f.Vec4f | ( | final Vec4f | o | ) |
Definition at line 45 of file Vec4f.java.
| com.jogamp.math.Vec4f.Vec4f | ( | final Vec3f | o, |
| final float | w | ||
| ) |
Creating new Vec4f using { o, w }.
Definition at line 50 of file Vec4f.java.
| com.jogamp.math.Vec4f.Vec4f | ( | final float[] | xyzw | ) |
Definition at line 58 of file Vec4f.java.
| com.jogamp.math.Vec4f.Vec4f | ( | final float | x, |
| final float | y, | ||
| final float | z, | ||
| final float | w | ||
| ) |
Definition at line 62 of file Vec4f.java.
| Vec4f com.jogamp.math.Vec4f.add | ( | final float | dx, |
| final float | dy, | ||
| final float | dz, | ||
| final float | dw | ||
| ) |
this = this + { dx, dy, dz, dw }, returns this.
Definition at line 237 of file Vec4f.java.
this = this + b, returns this.
Definition at line 246 of file Vec4f.java.
| float com.jogamp.math.Vec4f.angle | ( | final Vec4f | o | ) |
Return the angle between two vectors in radians.
Definition at line 357 of file Vec4f.java.
| Vec4f com.jogamp.math.Vec4f.copy | ( | ) |
| float com.jogamp.math.Vec4f.cosAngle | ( | final Vec4f | o | ) |
Return the cosines of the angle between two vectors.
Definition at line 350 of file Vec4f.java.
| float com.jogamp.math.Vec4f.dist | ( | final Vec4f | o | ) |
Return the distance between this vector and the given one.
Definition at line 334 of file Vec4f.java.
| float com.jogamp.math.Vec4f.distSq | ( | final Vec4f | 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 323 of file Vec4f.java.
this = this / a, returns this.
Definition at line 205 of file Vec4f.java.
this = a / b, returns this.
Definition at line 196 of file Vec4f.java.
| float com.jogamp.math.Vec4f.dot | ( | final Vec4f | o | ) |
Return the dot product of this vector and the given one.
Definition at line 343 of file Vec4f.java.
| boolean com.jogamp.math.Vec4f.equals | ( | final Object | o | ) |
| float[] com.jogamp.math.Vec4f.get | ( | final float[] | xyzw | ) |
xyzw = this, returns xyzw.
Definition at line 123 of file Vec4f.java.
| float com.jogamp.math.Vec4f.get | ( | final int | i | ) |
Gets the ith component, 0 <= i < 4.
Definition at line 132 of file Vec4f.java.
| boolean com.jogamp.math.Vec4f.isEqual | ( | final Vec4f | 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 397 of file Vec4f.java.
| boolean com.jogamp.math.Vec4f.isEqual | ( | final Vec4f | 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 374 of file Vec4f.java.
| boolean com.jogamp.math.Vec4f.isZero | ( | ) |
Return true if all components are zero, i.e.
it's absolute value < EPSILON.
Definition at line 278 of file Vec4f.java.
| float com.jogamp.math.Vec4f.length | ( | ) |
Return the length of this vector, a.k.a the norm or magnitude
Definition at line 285 of file Vec4f.java.
| float com.jogamp.math.Vec4f.lengthSq | ( | ) |
Return the squared length of this vector, a.k.a the squared norm or squared magnitude
Definition at line 292 of file Vec4f.java.
this = max(this, m), returns this.
Definition at line 153 of file Vec4f.java.
this = min(this, m), returns this.
Definition at line 161 of file Vec4f.java.
this = a - b, returns this.
Definition at line 260 of file Vec4f.java.
Returns this - arg; creates new vector.
Definition at line 255 of file Vec4f.java.
| Vec4f com.jogamp.math.Vec4f.mul | ( | final float | sx, |
| final float | sy, | ||
| final float | sz, | ||
| final float | sw | ||
| ) |
this = this * { sx, sy, sz, sw }, returns this.
Definition at line 187 of file Vec4f.java.
| Vec4f com.jogamp.math.Vec4f.mul | ( | final float | val | ) |
Returns this * val; creates new vector.
Definition at line 170 of file Vec4f.java.
this = a * b, returns this.
Definition at line 175 of file Vec4f.java.
this = this * s, returns this.
Definition at line 184 of file Vec4f.java.
| Vec4f com.jogamp.math.Vec4f.normalize | ( | ) |
Normalize this vector in place.
Definition at line 299 of file Vec4f.java.
this = a + b, returns this.
Definition at line 228 of file Vec4f.java.
Returns this + arg; creates new vector.
Definition at line 223 of file Vec4f.java.
| Vec4f com.jogamp.math.Vec4f.scale | ( | final float | s | ) |
this = this * s, returns this.
Definition at line 214 of file Vec4f.java.
| Vec4f com.jogamp.math.Vec4f.set | ( | final float | x, |
| final float | y, | ||
| final float | z, | ||
| final float | w | ||
| ) |
this = { x, y, z, w }, returns this.
Definition at line 85 of file Vec4f.java.
| Vec4f com.jogamp.math.Vec4f.set | ( | final float[] | xyzw | ) |
this = xyzw, returns this.
Definition at line 94 of file Vec4f.java.
| void com.jogamp.math.Vec4f.set | ( | final int | i, |
| final float | val | ||
| ) |
Sets the ith component, 0 <= i < 4.
Definition at line 112 of file Vec4f.java.
this = { o, w }, returns this.
Definition at line 76 of file Vec4f.java.
this = o, returns this.
Definition at line 67 of file Vec4f.java.
| void com.jogamp.math.Vec4f.setW | ( | final float | w | ) |
Definition at line 150 of file Vec4f.java.
| void com.jogamp.math.Vec4f.setX | ( | final float | x | ) |
Definition at line 147 of file Vec4f.java.
| void com.jogamp.math.Vec4f.setY | ( | final float | y | ) |
Definition at line 148 of file Vec4f.java.
| void com.jogamp.math.Vec4f.setZ | ( | final float | z | ) |
this = this - b, returns this.
Definition at line 269 of file Vec4f.java.
| Vec4f com.jogamp.math.Vec4f.toArray | ( | final float[] | xyzw | ) |
| String com.jogamp.math.Vec4f.toString | ( | ) |
Definition at line 418 of file Vec4f.java.
| float com.jogamp.math.Vec4f.w | ( | ) |
Definition at line 145 of file Vec4f.java.
| float com.jogamp.math.Vec4f.x | ( | ) |
Definition at line 142 of file Vec4f.java.
| float com.jogamp.math.Vec4f.y | ( | ) |
Definition at line 143 of file Vec4f.java.
| float com.jogamp.math.Vec4f.z | ( | ) |
Definition at line 144 of file Vec4f.java.