[update] Moved codes which transpose a matrix, to GLSL.

This commit is contained in:
falsycat 2019-10-10 00:00:00 +00:00
parent 4ea0041c54
commit 111c98bea2
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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) {