Added ClearRotation() and SetScale(float) in Transform class.

This commit is contained in:
hyzboy 2024-07-30 23:53:30 +08:00
parent 7f39d77318
commit 7165984d22

View File

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