From db9d15b78ab19b33f1976aa0d09bfed6d43f45ac Mon Sep 17 00:00:00 2001 From: Daan Vanden Bosch Date: Mon, 4 Nov 2019 18:01:11 +0100 Subject: [PATCH] Fixed bug in computation of inverse rotation of section. The bug manifested while manually translating an entity across a rotated section. --- src/quest_editor/model/SectionModel.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/quest_editor/model/SectionModel.ts b/src/quest_editor/model/SectionModel.ts index 6474d444..9c70baef 100644 --- a/src/quest_editor/model/SectionModel.ts +++ b/src/quest_editor/model/SectionModel.ts @@ -1,5 +1,5 @@ import { AreaVariantModel } from "./AreaVariantModel"; -import { Euler, Vector3 } from "three"; +import { Euler, Quaternion, Vector3 } from "three"; export class SectionModel { readonly id: number; @@ -18,7 +18,9 @@ export class SectionModel { this.id = id; this.position = position; this.rotation = rotation; - this.inverse_rotation = rotation.clone().reorder("YXZ"); + this.inverse_rotation = new Euler().setFromQuaternion( + new Quaternion().setFromEuler(rotation).inverse(), + ); this.area_variant = area_variant; } }