|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
3D Vector based upon three double components. More...
Public Member Functions | |
| Vec3d () | |
| Vec3d (final Vec3d o) | |
| Vec3d (final Vec4f o) | |
| Creating new Vec3f using Vec4f, dropping w. More... | |
| Vec3d (final Vec2f o, final double z) | |
| Creating new Vec3f using { Vec2f, z}. More... | |
| Vec3d | copy () |
| Vec3d (final double[] xyz) | |
| Vec3d (final double x, final double y, final double z) | |
| Vec3d | set (final Vec3d o) |
| this = o, returns this. More... | |
| Vec3d | set (final Vec2f o, final double z) |
| this = { o, z }, returns this. More... | |
| Vec3d | set (final Vec4f o) |
| this = o while dropping w, returns this. More... | |
| Vec3d | set (final double x, final double y, final double z) |
| this = { x, y, z }, returns this. More... | |
| Vec3d | set (final double[] xyz) |
| this = xyz, returns this. More... | |
| Vec3d | toArray (final double[] xyz) |
| xyz[0..2] = this. More... | |
| void | set (final int i, final double val) |
| Sets the ith component, 0 <= i < 3. More... | |
| double[] | get (final double[] xyz) |
| xyz = this, returns xyz. More... | |
| double | get (final int i) |
| Gets the ith component, 0 <= i < 3. More... | |
| double | x () |
| double | y () |
| double | z () |
| void | setX (final double x) |
| void | setY (final double y) |
| void | setZ (final double z) |
| Vec3d | max (final Vec3d m) |
| this = max(this, m), returns this. More... | |
| Vec3d | min (final Vec3d m) |
| this = min(this, m), returns this. More... | |
| Vec3d | mul (final double val) |
| Returns this * val; creates new vector. More... | |
| Vec3d | mul (final Vec3d a, final Vec3d b) |
| this = a * b, returns this. More... | |
| Vec3d | mul (final Vec3d s) |
| this = this * s, returns this. More... | |
| Vec3d | mul (final double sx, final double sy, final double sz) |
| this = this * { sx, sy, sz }, returns this. More... | |
| Vec3d | div (final Vec3d a, final Vec3d b) |
| this = a / b, returns this. More... | |
| Vec3d | div (final Vec3d a) |
| this = this / a, returns this. More... | |
| Vec3d | scale (final double s) |
| this = this * s, returns this. More... | |
| Vec3d | plus (final Vec3d arg) |
| Returns this + arg; creates new vector. More... | |
| Vec3d | plus (final Vec3d a, final Vec3d b) |
| this = a + b, returns this. More... | |
| Vec3d | add (final double dx, final double dy, final double dz) |
| this = this + { dx, dy, dz }, returns this. More... | |
| Vec3d | add (final Vec3d b) |
| this = this + b, returns this. More... | |
| Vec3d | minus (final Vec3d arg) |
| Returns this - arg; creates new vector. More... | |
| Vec3d | minus (final Vec3d a, final Vec3d b) |
| this = a - b, returns this. More... | |
| Vec3d | sub (final Vec3d b) |
| this = this - b, returns this. More... | |
| boolean | isZero () |
| Return true if all components are zero, i.e. More... | |
| double | length () |
| Return the length of this vector, a.k.a the norm or magnitude More... | |
| double | lengthSq () |
| Return the squared length of this vector, a.k.a the squared norm or squared magnitude More... | |
| Vec3d | normalize () |
| Normalize this vector in place. More... | |
| double | distSq (final Vec3d o) |
| Return the squared distance between this vector and the given one. More... | |
| double | dist (final Vec3d o) |
| Return the distance between this vector and the given one. More... | |
| double | dot (final Vec3d o) |
| Return the dot product of this vector and the given one. More... | |
| Vec3d | cross (final Vec3d arg) |
| Returns this cross arg; creates new vector. More... | |
| Vec3d | cross (final Vec3d a, final Vec3d b) |
| this = a cross b. More... | |
| double | cosAngle (final Vec3d o) |
Return the cosine of the angle between two vectors using dot(Vec3d). More... | |
| double | angle (final Vec3d o) |
Return the angle between two vectors in radians using Math#acos(double) on cosAngle(Vec3d). More... | |
| boolean | isEqual (final Vec3d o, final double epsilon) |
Equals check using a given DoubleUtil#EPSILON value and DoubleUtil#isEqual(double, double, double). More... | |
| boolean | isEqual (final Vec3d o) |
Equals check using DoubleUtil#EPSILON in DoubleUtil#isEqual(double, double). More... | |
| boolean | equals (final Object o) |
| String | toString () |
3D Vector based upon three double components.
Implementation borrowed from gfxbox2 and its data layout from JOAL's Vec3f.
Definition at line 38 of file Vec3d.java.
| com.jogamp.math.Vec3d.Vec3d | ( | ) |
| com.jogamp.math.Vec3d.Vec3d | ( | final Vec3d | o | ) |
Definition at line 45 of file Vec3d.java.
| com.jogamp.math.Vec3d.Vec3d | ( | final Vec4f | o | ) |
Creating new Vec3f using Vec4f, dropping w.
Definition at line 50 of file Vec3d.java.
| com.jogamp.math.Vec3d.Vec3d | ( | final Vec2f | o, |
| final double | z | ||
| ) |
Creating new Vec3f using { Vec2f, z}.
Definition at line 55 of file Vec3d.java.
| com.jogamp.math.Vec3d.Vec3d | ( | final double[] | xyz | ) |
Definition at line 63 of file Vec3d.java.
| com.jogamp.math.Vec3d.Vec3d | ( | final double | x, |
| final double | y, | ||
| final double | z | ||
| ) |
Definition at line 67 of file Vec3d.java.
| Vec3d com.jogamp.math.Vec3d.add | ( | final double | dx, |
| final double | dy, | ||
| final double | dz | ||
| ) |
this = this + { dx, dy, dz }, returns this.
Definition at line 232 of file Vec3d.java.
this = this + b, returns this.
Definition at line 240 of file Vec3d.java.
| double com.jogamp.math.Vec3d.angle | ( | final Vec3d | o | ) |
Return the angle between two vectors in radians using Math#acos(double) on cosAngle(Vec3d).
Definition at line 359 of file Vec3d.java.
| Vec3d com.jogamp.math.Vec3d.copy | ( | ) |
| double com.jogamp.math.Vec3d.cosAngle | ( | final Vec3d | o | ) |
Return the cosine of the angle between two vectors using dot(Vec3d).
Definition at line 352 of file Vec3d.java.
this = a cross b.
NOTE: "this" must be a different vector than both a and b.
Definition at line 342 of file Vec3d.java.
Returns this cross arg; creates new vector.
Definition at line 336 of file Vec3d.java.
| double com.jogamp.math.Vec3d.dist | ( | final Vec3d | o | ) |
Return the distance between this vector and the given one.
Definition at line 322 of file Vec3d.java.
| double com.jogamp.math.Vec3d.distSq | ( | final Vec3d | 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 312 of file Vec3d.java.
this = this / a, returns this.
Definition at line 203 of file Vec3d.java.
this = a / b, returns this.
Definition at line 195 of file Vec3d.java.
| double com.jogamp.math.Vec3d.dot | ( | final Vec3d | o | ) |
Return the dot product of this vector and the given one.
Definition at line 331 of file Vec3d.java.
| boolean com.jogamp.math.Vec3d.equals | ( | final Object | o | ) |
| double[] com.jogamp.math.Vec3d.get | ( | final double[] | xyz | ) |
xyz = this, returns xyz.
Definition at line 130 of file Vec3d.java.
| double com.jogamp.math.Vec3d.get | ( | final int | i | ) |
Gets the ith component, 0 <= i < 3.
Definition at line 138 of file Vec3d.java.
| boolean com.jogamp.math.Vec3d.isEqual | ( | final Vec3d | o | ) |
Equals check using DoubleUtil#EPSILON in DoubleUtil#isEqual(double, double).
Implementation considers following corner cases:
| o | comparison value |
DoubleUtil#EPSILON, otherwise false. Definition at line 398 of file Vec3d.java.
| boolean com.jogamp.math.Vec3d.isEqual | ( | final Vec3d | o, |
| final double | epsilon | ||
| ) |
Equals check using a given DoubleUtil#EPSILON value and DoubleUtil#isEqual(double, double, double).
Implementation considers following corner cases:
| o | comparison value |
| epsilon | consider using DoubleUtil#EPSILON |
epsilon, otherwise false. Definition at line 376 of file Vec3d.java.
| boolean com.jogamp.math.Vec3d.isZero | ( | ) |
Return true if all components are zero, i.e.
it's absolute value < EPSILON.
Definition at line 269 of file Vec3d.java.
| double com.jogamp.math.Vec3d.length | ( | ) |
Return the length of this vector, a.k.a the norm or magnitude
Definition at line 276 of file Vec3d.java.
| double com.jogamp.math.Vec3d.lengthSq | ( | ) |
Return the squared length of this vector, a.k.a the squared norm or squared magnitude
Definition at line 283 of file Vec3d.java.
this = max(this, m), returns this.
Definition at line 156 of file Vec3d.java.
this = min(this, m), returns this.
Definition at line 163 of file Vec3d.java.
this = a - b, returns this.
Definition at line 253 of file Vec3d.java.
Returns this - arg; creates new vector.
Definition at line 248 of file Vec3d.java.
| Vec3d com.jogamp.math.Vec3d.mul | ( | final double | sx, |
| final double | sy, | ||
| final double | sz | ||
| ) |
this = this * { sx, sy, sz }, returns this.
Definition at line 187 of file Vec3d.java.
| Vec3d com.jogamp.math.Vec3d.mul | ( | final double | val | ) |
Returns this * val; creates new vector.
Definition at line 171 of file Vec3d.java.
this = a * b, returns this.
Definition at line 176 of file Vec3d.java.
this = this * s, returns this.
Definition at line 184 of file Vec3d.java.
| Vec3d com.jogamp.math.Vec3d.normalize | ( | ) |
Normalize this vector in place.
Definition at line 290 of file Vec3d.java.
this = a + b, returns this.
Definition at line 224 of file Vec3d.java.
Returns this + arg; creates new vector.
Definition at line 219 of file Vec3d.java.
| Vec3d com.jogamp.math.Vec3d.scale | ( | final double | s | ) |
this = this * s, returns this.
Definition at line 211 of file Vec3d.java.
| Vec3d com.jogamp.math.Vec3d.set | ( | final double | x, |
| final double | y, | ||
| final double | z | ||
| ) |
this = { x, y, z }, returns this.
Definition at line 96 of file Vec3d.java.
| Vec3d com.jogamp.math.Vec3d.set | ( | final double[] | xyz | ) |
this = xyz, returns this.
Definition at line 104 of file Vec3d.java.
| void com.jogamp.math.Vec3d.set | ( | final int | i, |
| final double | val | ||
| ) |
Sets the ith component, 0 <= i < 3.
Definition at line 120 of file Vec3d.java.
this = { o, z }, returns this.
Definition at line 80 of file Vec3d.java.
this = o, returns this.
Definition at line 72 of file Vec3d.java.
this = o while dropping w, returns this.
Definition at line 88 of file Vec3d.java.
| void com.jogamp.math.Vec3d.setX | ( | final double | x | ) |
Definition at line 151 of file Vec3d.java.
| void com.jogamp.math.Vec3d.setY | ( | final double | y | ) |
Definition at line 152 of file Vec3d.java.
| void com.jogamp.math.Vec3d.setZ | ( | final double | z | ) |
Definition at line 153 of file Vec3d.java.
this = this - b, returns this.
Definition at line 261 of file Vec3d.java.
| Vec3d com.jogamp.math.Vec3d.toArray | ( | final double[] | xyz | ) |
| String com.jogamp.math.Vec3d.toString | ( | ) |
Definition at line 418 of file Vec3d.java.
| double com.jogamp.math.Vec3d.x | ( | ) |
Definition at line 147 of file Vec3d.java.
| double com.jogamp.math.Vec3d.y | ( | ) |
Definition at line 148 of file Vec3d.java.
| double com.jogamp.math.Vec3d.z | ( | ) |
Definition at line 149 of file Vec3d.java.