From 111c98bea2764116815668da2bdbee8c6dbeceb4 Mon Sep 17 00:00:00 2001 From: falsycat Date: Thu, 10 Oct 2019 00:00:00 +0000 Subject: [PATCH] [update] Moved codes which transpose a matrix, to GLSL. --- sjplayer/src/sjplayer/CircleElement.d | 6 +++--- sjplayer/src/sjplayer/ScheduledController.d | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sjplayer/src/sjplayer/CircleElement.d b/sjplayer/src/sjplayer/CircleElement.d index a2000ce..cfacf65 100644 --- a/sjplayer/src/sjplayer/CircleElement.d +++ b/sjplayer/src/sjplayer/CircleElement.d @@ -14,7 +14,7 @@ class CircleElement : ElementInterface { public: /// static struct Instance { - /// this should be transposed + /// align(1) mat3 matrix = mat3.identity; /// align(1) float weight = 1; @@ -35,7 +35,7 @@ class CircleElement : ElementInterface { override DamageCalculationResult CalculateDamage(vec2 p1, vec2 p2) const { if (!alive) return DamageCalculationResult(0, 0); - const m = matrix.transposed.inverse; + const m = matrix.inverse; const a = (m * vec3(p1, 1)).xy; const b = (m * vec3(p2, 1)).xy; @@ -107,7 +107,7 @@ class CircleElementProgram { out vec4 color_; void main() { - mat3 m = mat3(m1, m2, m3); + mat3 m = transpose(mat3(m1, m2, m3)); vec2 pos = (m * vec3(vert, 1)).xy; uv_ = vert; diff --git a/sjplayer/src/sjplayer/ScheduledController.d b/sjplayer/src/sjplayer/ScheduledController.d index 997b496..2d33298 100644 --- a/sjplayer/src/sjplayer/ScheduledController.d +++ b/sjplayer/src/sjplayer/ScheduledController.d @@ -55,7 +55,7 @@ class ScheduledController( override void ProcessOperation(float time, ref in ParametersBlock params) { super.ProcessOperation(time, params); static if (MatrixModificationAvailable) { - target_.matrix = matrix_factory_.Create().transposed; + target_.matrix = matrix_factory_.Create(); } } override void FinalizeOperation(ref in ParametersBlock params) {