From 7165984d2270c61f19653a3a256c05786ec478fa Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 30 Jul 2024 23:53:30 +0800 Subject: [PATCH] Added ClearRotation() and SetScale(float) in Transform class. --- inc/hgl/math/Matrix.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/inc/hgl/math/Matrix.h b/inc/hgl/math/Matrix.h index e0b6b63..9d87d32 100644 --- a/inc/hgl/math/Matrix.h +++ b/inc/hgl/math/Matrix.h @@ -321,6 +321,14 @@ namespace hgl matrix_dirty=true; } + void ClearRotation() + { + rotation_quat=IdentityQuatf; + rotation_axis=Vector3f(0,0,0); + rotate_angle=0; + matrix_dirty=true; + } + void SetRotation(const Quatf &q) { rotation_quat=q; @@ -360,6 +368,12 @@ namespace hgl UpdateQuat(); } + void SetScale(const float &v) + { + scale_vector=Vector3f(v,v,v); + matrix_dirty=true; + } + void SetScale(const Vector3f &v) { scale_vector=v;