aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/math
Commit message (Collapse)AuthorAgeFilesLines
* FloatUtil Epsilon ops: Generalize all epsilon operations by allowing passing ↵Sven Göthel2024-02-141-6/+26
| | | | a zero epsilon value to reduce complexity in upper math layers
* Use FloatUtil.isZero(a) w/ build-in FloatUtil.EPSILON directly instead of ↵Sven Göthel2024-02-142-12/+12
| | | | passing FloatUtil.EPSILON to explicit isZero(a, epsilon)
* Bug 1501: VectorUtil: Deprecate prev line2line intersection tests, adding ↵Sven Göthel2024-02-131-72/+476
| | | | | | | | | | | new impl; Add isConvex*() to determine whether a polyline is convex I had problems using the previous line2line intersection methods in my (and my son's) C++ gfxbox2 project, e.g. freefall01. Hence I found a different solution, also using less operations: <https://jausoft.com/cgit/cs_class/gfxbox2.git/tree/include/pixel/pixel2f.hpp#n660> While adding intersection tests for our Delaunay (Bug 1501) .. I came across this issue again and hence swapped the implementation.
* VectorUtil: Consolidate names, remove unused float prevision variants (if any)Sven Göthel2024-02-131-69/+45
|
* VectorUtil: Remove unused isInCircleVec2f() and triAreaVec2f(), now using ↵Sven Göthel2024-02-121-34/+8
| | | | *2d() variants
* Bug 1501: Graph Delaunay: Use default winding outer-boundary:=CCW and ↵Sven Göthel2024-02-121-11/+45
| | | | | | | | | | | inner-hole:=CW w/o using winding determination (might be incorrect) This simplifies our code further and it has been validated that our polygon shoelace-algo for area >= 0 ? CCW doesn't produce correct results with all curves. Hence rely on given winding depending on outer-boundary and inner-hole if CDTriangulator2D.FixedWindingRule == true (default and fixed). This also removes the more costly winding shoelace calculus, hence Outline ctor only sets dirtyWinding:=true w/o calculating the winding.
* Bug 1501: Graph Delaunay: Add double triAreaVec2() and isInCircleVec2() ↵Sven Göthel2024-02-121-18/+65
| | | | | | | | | | | | version, overcome float precision; Loop: Pass edgeType not Winding, simplify findClosestValidNeighbor() -> isValidNeighbor(); CDTriangulator2D.addCurve() enforces Winding.CCW on BOUNDARY null == loop case Add double version of triAreaVec2() and isInCircleVec2() in VectorUtil, overcoming float precision limits - Analysis exposed float precision limits within isInCircleVec2() Loop: Pass edgeType not Winding, simplify findClosestValidNeighbor() -> isValidNeighbor() - Enhance code clarity CDTriangulator2D.addCurve() enforces Winding.CCW on BOUNDARY null == loop case
* Remove Clonable and clone() in favor of explicit determined copy() and ↵Sven Göthel2024-02-022-38/+3
| | | | copy-ctor in com.jogamp.graph.* and com.jogamp.math.*
* Vec[234][ifd]: Add toArray(..) methodSven Göthel2024-02-015-0/+39
|
* Add Vec2f.set(Vec2i) and Vec2f(Vec2i); Add Texture.set(..) allowing a ↵Sven Göthel2024-01-311-0/+10
| | | | pending setup/update of texture and image dimensions
* Math Vec*: Rename {scale->mul}(..) for non-scalar types (n-dim); Add div(..)Sven Göthel2024-01-266-50/+114
|
* Bug 1490 - GraphUI Group: Resolve Performance Issues with Shape Mv Transform ↵Sven Göthel2024-01-221-0/+2
| | | | | | | | | | | | | | | | | | | | -> PMVMatrix4f Shape.setTransformMv() is called for each renderer frame and for each shape, involving 6 Matrix4f.mul() and set*() operations. Since mutation of shape's position, rotation or scale is less frequent than rendering one frame (for all shapes), it is more efficient to maintain a local Matrix4f and update it on such single mutations. Rendering then only needs to perform one Matrix4f.mul() operation using this internal matrix. +++ Also changes name from setTransformMv(PMVMatrix4f) to applyMatToMv(PMVMatrix4f), as its name might be misleading.
* Frustum: Revise code and its Plane definition to support Cube->Frustum as ↵Sven Göthel2024-01-193-50/+198
| | | | | | | | | | | | | | | | | | | | | | | | | well as to extract planes for float[] vec4-shader uniforms. commit 1040bed4ecc6f4598ea459f1073a9240583fc3c3 added AABBox -> Cube -> Frustum mapping (incomplete) and requires Frustum.Plane.set(..) by normal and point-on-plane for distance. Frustum.isOutside(Cube) has been added, testing all its 8-points similar to AABBox. Further all 6 Frustum.Plane shall be extracted to Vec4f and float[], the latter to pass the whole float[4*6] as a vec4[6] uniform array to the shader. +++ Constructor, setter and getter have been adjusted accordingly. Most of the loops have been unrolled. +++ Method names to query Frustum, i.e. 'is*Outside(<Type>)' have been reduced to 'isOutside(<Type>)' where <Type> uniquely indenticates the purpose. Hence only 'isSphereOutside()' is left over.
* Add Cube to Frustum Plane mapping, supporting transformation of object-space ↵Sven Göthel2024-01-192-1/+251
| | | | AABBox into model-view Cube to Frustum.Plane for culling (cpu) and clipping (gpu)
* AABBox: Rename private fields {bl, tr} -> {lo, hi} denoting proper ↵Sven Göthel2024-01-191-137/+137
| | | | | | | | | | | orientation in API doc br, tr wasn't sufficient as in commit d778889f36bd6bee999ceb502c5f0ce265b014bf while working on Frustum, as it doesn't properly reflect axis order not z. Hence going back to 'low' and 'high' semantics, but using same length identifier and emphasizing far (lo) < near (hi) of our model-view coordinate system.
* AABBox: Add intersects(AABBox), contains(AABBox), scale(float, float, float) ↵Sven Göthel2024-01-151-0/+59
| | | | and scale2(float, float, float)
* AABBox: Rename private fields low -> bl and hight -> tr for readability; ↵Sven Göthel2024-01-151-149/+187
| | | | Unroll getRayIntersection()'s 'find candidate planes'
* Matrix4f: Fix minor API doc parem ref-nameSven Göthel2024-01-131-1/+1
|
* AABBox resize{Width, Height}(..): Positive argument shall always denote ↵Sven Göthel2024-01-121-4/+4
| | | | expansion
* Bug 1452: PMVMatrix4f: Drop redundant unused mulWith*(Vec*...) 'v_out = M * ↵Sven Gothel2023-09-231-102/+0
| | | | v_in', user can simply get the desired matrix and apply its mulVec*(..) operation
* Bug 1452 - Decouple math functionality to 'com.jogamp.math' to be toolkit ↵Sven Gothel2023-09-2035-0/+14524
agnostic (PMVMatrix, Matrix4f, Vec4f, ..) Math functionality (PMVMatrix, Matrix4f, Vec4f, ..) - shall be used toolkit agnostic, e.g. independent from OpenGL - shall be reused within our upcoming Vulkan implementation - may also move outside of JOGL, i.e. GlueGen or within its own package to be reused for other purposed. The 'com.jogamp.opengl.util.PMVMatrix' currently also used to feed in GLUniformData via the toolkit agnostic SyncAction and SyncBuffer shall also be split to a toolkit agnostic variant. An OpenGL PMVMatrix specialization implementing GLMatrixFunc can still exist, being derived from the toolkit agnostic base implementation. +++ Initial commit .. compile clean, passing most unit tests.