aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-01-19 06:11:46 +0100
committerSven Göthel <[email protected]>2024-01-19 06:11:46 +0100
commit5cca51e32999a882e2a5f00cb45ecafc824ffd86 (patch)
tree0266df911dc3e39a68def66fc355d18c01c0433e /src/graphui/classes
parent1040bed4ecc6f4598ea459f1073a9240583fc3c3 (diff)
Frustum: Revise code and its Plane definition to support Cube->Frustum as 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.
Diffstat (limited to 'src/graphui/classes')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/Group.java4
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/Scene.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Group.java b/src/graphui/classes/com/jogamp/graph/ui/Group.java
index be34ecf3b..1202752b1 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/Group.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/Group.java
@@ -312,7 +312,7 @@ public class Group extends Shape implements Container {
if( shape.isVisible() ) {
pmv.pushMv();
shape.setTransformMv(pmv);
- if( !doFrustumCulling || !pmv.getFrustum().isAABBoxOutside( shape.getBounds() ) ) {
+ if( !doFrustumCulling || !pmv.getFrustum().isOutside( shape.getBounds() ) ) {
shape.draw(gl, renderer);
}
pmv.popMv();
@@ -340,7 +340,7 @@ public class Group extends Shape implements Container {
pmv.pushMv();
shape.setTransformMv(pmv);
- if( !doFrustumCulling || !pmv.getFrustum().isAABBoxOutside( shape.getBounds() ) ) {
+ if( !doFrustumCulling || !pmv.getFrustum().isOutside( shape.getBounds() ) ) {
shape.drawToSelect(gl, renderer);
}
pmv.popMv();
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Scene.java b/src/graphui/classes/com/jogamp/graph/ui/Scene.java
index 698aa2d2f..189c75c9d 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/Scene.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/Scene.java
@@ -481,7 +481,7 @@ public final class Scene implements Container, GLEventListener {
pmv.pushMv();
shape.setTransformMv(pmv);
- if( !doFrustumCulling || !pmv.getFrustum().isAABBoxOutside( shape.getBounds() ) ) {
+ if( !doFrustumCulling || !pmv.getFrustum().isOutside( shape.getBounds() ) ) {
shape.draw(gl, renderer);
}
pmv.popMv();
@@ -522,7 +522,7 @@ public final class Scene implements Container, GLEventListener {
pmv.pushMv();
shape.setTransformMv(pmv);
- if( !doFrustumCulling || !pmv.getFrustum().isAABBoxOutside( shape.getBounds() ) ) {
+ if( !doFrustumCulling || !pmv.getFrustum().isOutside( shape.getBounds() ) ) {
final float color = ( i + 1f ) / ( shapeCount + 2f );
// FIXME
// System.err.printf("drawGL: color %f, index %d of [0..%d[%n", color, i, shapeCount);