From c13d26e1fa40ac8d40e1b4f7c72e4c1ef3f6c5e8 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 22 May 2022 14:53:05 +0200 Subject: Core/GameObjects: Use all axis rotations for gameobject model collision, not just orientation --- src/common/Collision/Models/GameObjectModel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/common/Collision/Models/GameObjectModel.cpp') diff --git a/src/common/Collision/Models/GameObjectModel.cpp b/src/common/Collision/Models/GameObjectModel.cpp index bcbfed28f32..5ef59a727ea 100644 --- a/src/common/Collision/Models/GameObjectModel.cpp +++ b/src/common/Collision/Models/GameObjectModel.cpp @@ -23,6 +23,7 @@ #include "Log.h" #include "MapTree.h" #include "Timer.h" +#include using G3D::Vector3; using G3D::Ray; @@ -124,7 +125,7 @@ bool GameObjectModel::initialize(std::unique_ptr model iScale = modelOwner->GetScale(); iInvScale = 1.f / iScale; - G3D::Matrix3 iRotation = G3D::Matrix3::fromEulerAnglesZYX(modelOwner->GetOrientation(), 0, 0); + G3D::Matrix3 iRotation = modelOwner->GetRotation().toRotationMatrix(); iInvRot = iRotation.inverse(); // transform bounding box: mdl_box = AABox(mdl_box.low() * iScale, mdl_box.high() * iScale); @@ -275,7 +276,7 @@ bool GameObjectModel::UpdatePosition() iPos = owner->GetPosition(); - G3D::Matrix3 iRotation = G3D::Matrix3::fromEulerAnglesZYX(owner->GetOrientation(), 0, 0); + G3D::Matrix3 iRotation = owner->GetRotation().toRotationMatrix(); iInvRot = iRotation.inverse(); // transform bounding box: mdl_box = AABox(mdl_box.low() * iScale, mdl_box.high() * iScale); -- cgit v1.2.3