From 7f39d7731845b3592cab7b5267eac88f7b13573b Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 30 Jul 2024 13:54:44 +0800 Subject: [PATCH] added SetTranslation and operator constr Matrix4f in Transform --- inc/hgl/math/Matrix.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/inc/hgl/math/Matrix.h b/inc/hgl/math/Matrix.h index f06694b..e0b6b63 100644 --- a/inc/hgl/math/Matrix.h +++ b/inc/hgl/math/Matrix.h @@ -292,6 +292,8 @@ namespace hgl return matrix; } + operator const Matrix4f &(){return GetMatrix();} + const Matrix4f &GetInverseMatrix() { UpdateMatrix(); @@ -304,6 +306,14 @@ namespace hgl const Quatf & GetRotationQuat ()const{return rotation_quat;} const Vector3f &GetRotationAxis ()const{return rotation_axis;} const float GetRotateAngle ()const{return rotate_angle;} + + void SetTranslation(const float x,const float y,const float z) + { + translation_vector.x=x; + translation_vector.y=y; + translation_vector.z=z; + matrix_dirty=true; + } void SetTranslation(const Vector3f &v) {