aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-04-08 20:23:09 +0200
committerSven Gothel <[email protected]>2023-04-08 20:23:09 +0200
commit003eb8ca1f296f287dc3d224fa19781705e10dd9 (patch)
tree22e15bd8f0a58fd3a807dcb67b416d4d13d7e2b4 /src/jogl/classes/com/jogamp/opengl/util
parentfc93a9aca67d0c4a11f70601743f58723a7fddd3 (diff)
PMVMatrix: Expose temporary storage (w/o side-effects) for efficiency; GraphUI.Shape: Efficiently reuse matPMv and temporary PMVMatrix storage
Reuse PMv in Shape.getSurfaceSize() and Shape.winToShapeCoord(), for the latter we invert the reused PMv for mapWinToObj (i.e. UnProject).
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java43
1 files changed, 42 insertions, 1 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
index 6c0a6c351..0cba41f65 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
@@ -271,8 +271,49 @@ public final class PMVMatrix implements GLMatrixFunc {
}
//
- // Matrix4f access as well as their SyncedBuffer counterpart SyncedMatrix and SyncedMatrices
+ // Temporary storage access for efficiency
//
+
+ /**
+ * Return the first temporary Matrix4f exposed to be reused for efficiency.
+ * <p>
+ * Temporary storage is only used by this class within single method calls,
+ * hence has no side-effects.
+ * </p>
+ */
+ public final Matrix4f getTmp1Mat() { return mat4Tmp1; }
+
+ /**
+ * Return the second temporary Matrix4f exposed to be reused for efficiency.
+ * <p>
+ * Temporary storage is only used by this class within single method calls,
+ * hence has no side-effects.
+ * </p>
+ */
+ public final Matrix4f getTmp2Mat() { return mat4Tmp2; }
+
+ /**
+ * Return the first temporary Vec3f exposed to be reused for efficiency.
+ * <p>
+ * Temporary storage is only used by this class within single method calls,
+ * hence has no side-effects.
+ * </p>
+ */
+ public final Vec3f getTmp1Vec3f() { return vec3Tmp1; }
+
+ /**
+ * Return the first temporary Vec4f exposed to be reused for efficiency.
+ * <p>
+ * Temporary storage is only used by this class within single method calls,
+ * hence has no side-effects.
+ * </p>
+ */
+ public final Vec4f getTmp1Vec4f() { return vec4Tmp1; }
+
+ //
+ // Regular Matrix4f access as well as their SyncedBuffer counterpart SyncedMatrix and SyncedMatrices
+ //
+
/**
* Returns the {@link GLMatrixFunc#GL_TEXTURE_MATRIX texture matrix} (T).
* <p>