|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
Static Public Member Functions | |
| static boolean | isVec2Zero (final Vec3f vec) |
Return true if 2D vector components are zero, no FloatUtil#EPSILON is taken into consideration. More... | |
| static boolean | isZero (final float x, final float y, final float z, final float epsilon) |
| Return true if all three vector components are zero, i.e. More... | |
| static boolean | isZero (final float x, final float y, final float z) |
| Return true if all three vector components are zero, i.e. More... | |
| static float | distSquareVec3 (final float[] v1, final float[] v2) |
| Return the squared distance between the given two points described vector v1 and v2. More... | |
| static float | distVec3 (final float[] v1, final float[] v2) |
| Return the distance between the given two points described vector v1 and v2. More... | |
| static float | normSquareVec2 (final float[] vec) |
| Return the squared length of a vector, a.k.a the squared norm or squared magnitude More... | |
| static float | normSquareVec3 (final float[] vec) |
| Return the squared length of a vector, a.k.a the squared norm or squared magnitude More... | |
| static float | normSquareVec3 (final float[] vec, final int offset) |
| Return the squared length of a vector, a.k.a the squared norm or squared magnitude More... | |
| static float | normVec2 (final float[] vec) |
| Return the length of a vector, a.k.a the norm or magnitude More... | |
| static float[] | normalizeVec3 (final float[] vector) |
| Normalize a vector in place. More... | |
| static float[] | normalizeVec3 (final float[] vector, final int offset) |
| Normalize a vector in place. More... | |
| static float[] | scaleVec2 (final float[] result, final float[] vector, final float scale) |
| Scales a vector by param using given result float[], result = vector * scale. More... | |
| static float[] | scaleVec2 (final float[] result, final float[] vector, final float[] scale) |
| Scales a vector by param using given result float[], result = vector * scale. More... | |
| static float[] | divVec2 (final float[] result, final float[] vector, final float scale) |
| Divides a vector by param using given result float[], result = vector / scale. More... | |
| static float[] | divVec2 (final float[] result, final float[] vector, final float[] scale) |
| Divides a vector by param using given result float[], result = vector / scale. More... | |
| static float[] | addVec2 (final float[] result, final float[] v1, final float[] v2) |
| Adds two vectors, result = v1 + v2. More... | |
| static float[] | subVec2 (final float[] result, final float[] v1, final float[] v2) |
| Subtracts two vectors, result = v1 - v2. More... | |
| static float[] | crossVec3 (final float[] r, final int r_offset, final float[] v1, final int v1_offset, final float[] v2, final int v2_offset) |
| cross product vec1 x vec2 More... | |
| static Vec3f | midpoint (final Vec3f result, final Vec3f p1, final Vec3f p2) |
| Calculate the midpoint of two points. More... | |
| static float | determinant (final Vec3f a, final Vec3f b, final Vec3f c) |
| Return the determinant of 3 vectors. More... | |
| static boolean | isCollinear (final Vec3f v1, final Vec3f v2, final Vec3f v3) |
| Check if three vertices are collinear. More... | |
| static boolean | isInCircle (final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c, final Vert2fImmutable d) |
Check if vertices in triangle circumcircle given d vertex, from paper by Guibas and Stolfi (1985). More... | |
| static double | inCircleVal (final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c, final Vert2fImmutable d) |
| static double | triArea (final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c) |
| Computes oriented double area of a triangle, i.e. More... | |
| static boolean | isInTriangle (final Vec3f a, final Vec3f b, final Vec3f c, final Vec3f p, final Vec3f ac, final Vec3f ab, final Vec3f ap) |
| Check if a vertex is in triangle using barycentric coordinates computation. More... | |
| static boolean | isInTriangle3 (final Vec3f a, final Vec3f b, final Vec3f c, final Vec3f p1, final Vec3f p2, final Vec3f p3, final Vec3f ac, final Vec3f ab, final Vec3f ap) |
| Check if one of three vertices are in triangle using barycentric coordinates computation. More... | |
| static boolean | isInTriangle3 (final Vec3f a, final Vec3f b, final Vec3f c, final Vec3f p1, final Vec3f p2, final Vec3f p3, final Vec3f ac, final Vec3f ab, final Vec3f ap, final float epsilon) |
| Check if one of three vertices are in triangle using barycentric coordinates computation, using given epsilon for comparison. More... | |
| static boolean | isCCW (final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c) |
| Check if points are in ccw order. More... | |
| static Winding | getWinding (final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c) |
| Compute the winding of the 3 given points. More... | |
| static double | area (final List<? extends Vert2fImmutable > vertices) |
| Computes the area of a list of vertices via shoelace formula. More... | |
| static Winding | getWinding (final List<? extends Vert2fImmutable > vertices) |
Compute the winding using the area(List) function over all vertices for complex shapes. More... | |
| static Vec4f | getPlaneVec3 (final Vec4f resultV4, final Vec3f normalVec3, final Vec3f pVec3) |
| Finds the plane equation of a plane given its normal and a point on the plane. More... | |
| static Vec4f | getPlaneVec3 (final Vec4f resultVec4, final Vec3f v1, final Vec3f v2, final Vec3f v3, final Vec3f temp1V3, final Vec3f temp2V3, final Vec3f temp3V3) |
| This finds the plane equation of a triangle given three vertices. More... | |
| static Vec3f | line2PlaneIntersection (final Vec3f result, final Ray ray, final Vec4f plane, final float epsilon) |
| Return intersection of an infinite line with a plane if exists, otherwise null. More... | |
| static Vec3f | line2lineIntersection0 (final Vec3f result, final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c, final Vert2fImmutable d) |
| Compute intersection between two lines. More... | |
| static Vec3f | seg2SegIntersection0 (final Vec3f result, final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c, final Vert2fImmutable d) |
| Compute intersection between two segments. More... | |
| static boolean | testSeg2SegIntersection0 (final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c, final Vert2fImmutable d) |
| Compute intersection between two segments. More... | |
| static boolean | testTri2SegIntersection0 (final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c, final Vert2fImmutable d, final Vert2fImmutable e) |
| Check if a segment intersects with a triangle. More... | |
| static boolean | seg2SegIntersection (final Vec3f result, final Vec2f p, final Vec2f p2, final Vec2f q, final Vec2f q2, final float epsilon, final boolean doCollinear) |
| Line segment intersection test and returning the intersecting point. More... | |
| static boolean | testSeg2SegIntersection (final Vec2f p, final Vec2f p2, final Vec2f q, final Vec2f q2, final float epsilon, final boolean doCollinear) |
| Line segment intersection test. More... | |
| static boolean | testSeg2SegIntersection (final Vert2fImmutable p, final Vert2fImmutable p2, final Vert2fImmutable q, final Vert2fImmutable q2, final float epsilon, final boolean doCollinear) |
| Line segment intersection test. More... | |
| static boolean | testTri2SegIntersection (final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c, final Vert2fImmutable d, final Vert2fImmutable e, final float epsilon, final boolean doCollinear) |
| Check if a segment intersects with a triangle. More... | |
| static boolean | testSeg2SegIntersection (final Vert2fImmutable p, final Vert2fImmutable p2, final Vert2fImmutable q, final Vert2fImmutable q2) |
Line segment intersection test using FloatUtil#EPSILON w/o considering collinear-case. More... | |
| static boolean | testTri2SegIntersection (final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c, final Vert2fImmutable d, final Vert2fImmutable e) |
Check if a segment intersects with a triangle using FloatUtil#EPSILON w/o considering collinear-case. More... | |
| static boolean | isConvex0 (final List<? extends Vert2fImmutable > polyline, final boolean shortIsConvex) |
Returns whether the given polyline denotes a convex shape with O(n) complexity. More... | |
| static boolean | isConvex1 (final List< Vertex > polyline, final boolean shortIsConvex) |
Returns whether the given on-curve polyline points denotes a convex shape with O(n) complexity. More... | |
| static boolean | isSelfIntersecting1 (final List< Vertex > polyline) |
Returns whether the given polyline is self-intersecting shape (crossing over) with O(n*n) complexity. More... | |
Definition at line 35 of file VectorUtil.java.
|
static |
Adds two vectors, result = v1 + v2.
| result | float[2] result vector, may be either v1 or v2 (in-place) |
| v1 | vector 1 |
| v2 | vector 2 |
Definition at line 222 of file VectorUtil.java.
|
static |
Computes the area of a list of vertices via shoelace formula.
This method is utilized e.g. to reliably compute the Winding of complex shapes.
Implementation uses double precision.
| vertices |
Definition at line 558 of file VectorUtil.java.
|
static |
cross product vec1 x vec2
| v1 | vector 1 |
| v2 | vector 2 |
Definition at line 247 of file VectorUtil.java.
|
static |
Return the determinant of 3 vectors.
| a | vector 1 |
| b | vector 2 |
| c | vector 3 |
Definition at line 275 of file VectorUtil.java.
|
static |
Return the squared distance between the given two points described vector v1 and v2.
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 74 of file VectorUtil.java.
|
static |
Return the distance between the given two points described vector v1 and v2.
Definition at line 84 of file VectorUtil.java.
|
static |
Divides a vector by param using given result float[], result = vector / scale.
| result | vector for the result, may be vector (in-place) |
| vector | input vector |
| scale | single scale constant for all vector components |
Definition at line 195 of file VectorUtil.java.
|
static |
Divides a vector by param using given result float[], result = vector / scale.
| result | vector for the result, may be vector (in-place) |
| vector | input vector |
| scale | 2 component scale constant for each vector component |
Definition at line 208 of file VectorUtil.java.
|
static |
Finds the plane equation of a plane given its normal and a point on the plane.
| resultV4 | vec4 plane equation |
| normalVec3 | |
| pVec3 |
Definition at line 594 of file VectorUtil.java.
|
static |
This finds the plane equation of a triangle given three vertices.
| resultVec4 | vec4 plane equation |
| v1 | vec3 |
| v2 | vec3 |
| v3 | vec3 |
| temp1V3 | |
| temp2V3 |
Definition at line 616 of file VectorUtil.java.
|
static |
Compute the winding using the area(List) function over all vertices for complex shapes.
Uses the area(List) function over all points on complex shapes for a reliable result!
Implementation uses double precision.
| vertices | array of Vertices |
Winding#CCW or Winding#CW Definition at line 582 of file VectorUtil.java.
|
static |
Compute the winding of the 3 given points.
Consider using getWinding(List) using the area(List) function over all points on complex shapes for a reliable result!
| a | first vertex |
| b | second vertex |
| c | third vertex |
Winding#CCW or Winding#CW Definition at line 542 of file VectorUtil.java.
|
static |
Definition at line 304 of file VectorUtil.java.
|
static |
Check if points are in ccw order.
Consider using getWinding(List) using the area(List) function over all points on complex shapes for a reliable result!
| a | first vertex |
| b | second vertex |
| c | third vertex |
Definition at line 526 of file VectorUtil.java.
|
static |
Check if three vertices are collinear.
| v1 | vertex 1 |
| v2 | vertex 2 |
| v3 | vertex 3 |
Definition at line 286 of file VectorUtil.java.
|
static |
Returns whether the given polyline denotes a convex shape with O(n) complexity.
See Determine whether a polygon is convex based on its vertices
| polyline | connected Vert2fImmutable, i.e. a poly-line |
| shortIsConvex | return value if vertices have less than three elements, allows simplification |
Definition at line 1092 of file VectorUtil.java.
|
static |
Returns whether the given on-curve polyline points denotes a convex shape with O(n) complexity.
See Determine whether a polygon is convex based on its vertices
All off-curve points are ignored.
| polyline | connected Vert2fImmutable, i.e. a poly-line |
| shortIsConvex | return value if vertices have less than three elements, allows simplification |
Definition at line 1213 of file VectorUtil.java.
|
static |
Check if vertices in triangle circumcircle given d vertex, from paper by Guibas and Stolfi (1985).
Implementation uses double precision.
| a | triangle vertex 1 |
| b | triangle vertex 2 |
| c | triangle vertex 3 |
| d | vertex in question |
Definition at line 301 of file VectorUtil.java.
|
static |
Check if a vertex is in triangle using barycentric coordinates computation.
| a | first triangle vertex |
| b | second triangle vertex |
| c | third triangle vertex |
| p | the vertex in question |
| ac | temporary storage |
| ab | temporary storage |
| ap | temporary storage |
Definition at line 347 of file VectorUtil.java.
|
static |
Check if one of three vertices are in triangle using barycentric coordinates computation.
| a | first triangle vertex |
| b | second triangle vertex |
| c | third triangle vertex |
| p1 | the vertex in question |
| p2 | the vertex in question |
| p3 | the vertex in question |
| ac | temporary storage |
| ab | temporary storage |
| ap | temporary storage |
Definition at line 384 of file VectorUtil.java.
|
static |
Check if one of three vertices are in triangle using barycentric coordinates computation, using given epsilon for comparison.
| a | first triangle vertex |
| b | second triangle vertex |
| c | third triangle vertex |
| p1 | the vertex in question |
| p2 | the vertex in question |
| p3 | the vertex in question |
| tmpAC | |
| tmpAB | |
| tmpAP |
Definition at line 452 of file VectorUtil.java.
|
static |
Returns whether the given polyline is self-intersecting shape (crossing over) with O(n*n) complexity.
Definition at line 1340 of file VectorUtil.java.
|
static |
Return true if 2D vector components are zero, no FloatUtil#EPSILON is taken into consideration.
Definition at line 39 of file VectorUtil.java.
|
static |
Return true if all three vector components are zero, i.e.
it's their absolute value < FloatUtil#EPSILON.
Implementation uses FloatUtil#isZero(float), see API doc for details.
Definition at line 61 of file VectorUtil.java.
|
static |
Return true if all three vector components are zero, i.e.
it's their absolute value < epsilon.
Implementation uses FloatUtil#isZero(float, float), see API doc for details.
Definition at line 49 of file VectorUtil.java.
|
static |
Compute intersection between two lines.
| a | vertex 1 of first line |
| b | vertex 2 of first line |
| c | vertex 1 of second line |
| d | vertex 2 of second line |
Definition at line 663 of file VectorUtil.java.
|
static |
Return intersection of an infinite line with a plane if exists, otherwise null.
Thanks to Norman Vine – nhv@y.nosp@m.ahoo.nosp@m..com (with hacks by Steve)
| result | vec3 result buffer for intersecting coords |
| ray | here representing an infinite line, origin and direction. |
| plane | vec4 plane equation |
| epsilon |
Definition at line 641 of file VectorUtil.java.
|
static |
Calculate the midpoint of two points.
| p1 | first point vector |
| p2 | second point vector |
Definition at line 261 of file VectorUtil.java.
|
static |
Normalize a vector in place.
| vector | input vector |
Definition at line 126 of file VectorUtil.java.
|
static |
Normalize a vector in place.
| vector | input vector |
Definition at line 146 of file VectorUtil.java.
|
static |
Return the squared length of a vector, a.k.a the squared norm or squared magnitude
Definition at line 91 of file VectorUtil.java.
|
static |
Return the squared length of a vector, a.k.a the squared norm or squared magnitude
Definition at line 98 of file VectorUtil.java.
|
static |
Return the squared length of a vector, a.k.a the squared norm or squared magnitude
Definition at line 105 of file VectorUtil.java.
|
static |
Return the length of a vector, a.k.a the norm or magnitude
Definition at line 117 of file VectorUtil.java.
|
static |
Scales a vector by param using given result float[], result = vector * scale.
| result | vector for the result, may be vector (in-place) |
| vector | input vector |
| scale | single scale constant for all vector components |
Definition at line 168 of file VectorUtil.java.
|
static |
Scales a vector by param using given result float[], result = vector * scale.
| result | vector for the result, may be vector (in-place) |
| vector | input vector |
| scale | 2 component scale constant for each vector component |
Definition at line 181 of file VectorUtil.java.
|
static |
Line segment intersection test and returning the intersecting point.
See p + t r = q + u s and its terse C# implementation
Implementation uses float precision.
| p | vertex 1 of first segment |
| p2 | vertex 2 of first segment |
| q | vertex 1 of second segment |
| q2 | vertex 2 of second segment |
| epsilon | optional epsilon. If 0 just compare against 0, otherwise compare against this epsilon. See FloatUtil#EPSILON |
| doCollinear | consider collinear case, i.e. overlapping segments as an intersection returning true |
Definition at line 771 of file VectorUtil.java.
|
static |
Compute intersection between two segments.
| a | vertex 1 of first segment |
| b | vertex 2 of first segment |
| c | vertex 1 of second segment |
| d | vertex 2 of second segment |
Definition at line 687 of file VectorUtil.java.
|
static |
Subtracts two vectors, result = v1 - v2.
| result | float[2] result vector, may be either v1 or v2 (in-place) |
| v1 | vector 1 |
| v2 | vector 2 |
Definition at line 235 of file VectorUtil.java.
|
static |
Line segment intersection test.
See p + t r = q + u s and its terse C# implementation
Implementation uses float precision.
| p | vertex 1 of first segment |
| p2 | vertex 2 of first segment |
| q | vertex 1 of second segment |
| q2 | vertex 2 of second segment |
| epsilon | optional epsilon. If 0 just compare against 0, otherwise compare against this epsilon. See FloatUtil#EPSILON |
| doCollinear | consider collinear case, i.e. overlapping segments as an intersection returning true |
Definition at line 849 of file VectorUtil.java.
|
static |
Line segment intersection test using FloatUtil#EPSILON w/o considering collinear-case.
See p + t r = q + u s and its terse C# implementation
Implementation uses float precision.
| p | vertex 1 of first segment |
| p2 | vertex 2 of first segment |
| q | vertex 1 of second segment |
| q2 | vertex 2 of second segment |
Definition at line 1026 of file VectorUtil.java.
|
static |
Line segment intersection test.
See p + t r = q + u s and its terse C# implementation
Implementation uses float precision.
| p | vertex 1 of first segment |
| p2 | vertex 2 of first segment |
| q | vertex 1 of second segment |
| q2 | vertex 2 of second segment |
| epsilon | optional epsilon. If 0 just compare against 0, otherwise compare against this epsilon. See FloatUtil#EPSILON |
| doCollinear | consider collinear case, i.e. overlapping segments as an intersection returning true |
Definition at line 923 of file VectorUtil.java.
|
static |
Compute intersection between two segments.
| a | vertex 1 of first segment |
| b | vertex 2 of first segment |
| c | vertex 1 of second segment |
| d | vertex 2 of second segment |
testSeg2SegIntersection(Vert2fImmutable, Vert2fImmutable, Vert2fImmutable, Vert2fImmutable, float, boolean) Definition at line 715 of file VectorUtil.java.
|
static |
Check if a segment intersects with a triangle using FloatUtil#EPSILON w/o considering collinear-case.
Implementation uses float precision.
| a | vertex 1 of the triangle |
| b | vertex 2 of the triangle |
| c | vertex 3 of the triangle |
| d | vertex 1 of first segment |
| e | vertex 2 of first segment |
Definition at line 1077 of file VectorUtil.java.
|
static |
Check if a segment intersects with a triangle.
Implementation uses float precision.
| a | vertex 1 of the triangle |
| b | vertex 2 of the triangle |
| c | vertex 3 of the triangle |
| d | vertex 1 of first segment |
| e | vertex 2 of first segment |
| epsilon | optional epsilon. If 0 just compare against 0, otherwise compare against this epsilon. See FloatUtil#EPSILON |
| doCollinear | consider collinear case, i.e. overlapping segments as an intersection returning true |
Definition at line 1004 of file VectorUtil.java.
|
static |
Check if a segment intersects with a triangle.
| a | vertex 1 of the triangle |
| b | vertex 2 of the triangle |
| c | vertex 3 of the triangle |
| d | vertex 1 of first segment |
| e | vertex 2 of first segment |
testTri2SegIntersection(Vert2fImmutable, Vert2fImmutable, Vert2fImmutable, Vert2fImmutable, Vert2fImmutable, float, boolean) Definition at line 747 of file VectorUtil.java.
|
static |
Computes oriented double area of a triangle, i.e.
the 2x2 determinant with b-a and c-a per column.
| bx-ax, cx-ax |
det = | by-ay, cy-ay |
| a | first vertex |
| b | second vertex |
| c | third vertex |
Definition at line 329 of file VectorUtil.java.