aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-01-22 05:53:34 +0100
committerSven Göthel <[email protected]>2024-01-22 05:53:34 +0100
commita883f3e2e1563736df32573141fd5119f0678c92 (patch)
tree647dd5b5ec8fcd236406a27ed38d68eda0de5c7a /src/jogl/classes
parentffe4e670c9d35121934c6f3c95067d9c18aee386 (diff)
Bug 1490 - GraphUI Group: Resolve Performance Issues with Shape Mv Transform -> 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.
Diffstat (limited to 'src/jogl/classes')
-rw-r--r--src/jogl/classes/com/jogamp/math/Quaternion.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/math/Quaternion.java b/src/jogl/classes/com/jogamp/math/Quaternion.java
index 690c1b8dc..683c1fadc 100644
--- a/src/jogl/classes/com/jogamp/math/Quaternion.java
+++ b/src/jogl/classes/com/jogamp/math/Quaternion.java
@@ -65,6 +65,8 @@ public class Quaternion {
set(x, y, z, w);
}
+ public Quaternion copy() { return new Quaternion(this); }
+
/**
* See {@link #magnitude()} for special handling of {@link FloatUtil#EPSILON epsilon},
* which is not applied here.