Skip to content

Commit

Permalink
Add RotateZ function
Browse files Browse the repository at this point in the history
  • Loading branch information
unitoftime committed Dec 7, 2024
1 parent ff00d04 commit f68e2cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions glm/math.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ func (m *Mat4) GetTranslation() Vec3 {
return Vec3{m[i4_3_0], m[i4_3_1], m[i4_3_2]}
}

// Rotate around the Z axis
func (m *Mat4) RotateZ(angle float64) *Mat4 {
return m.Rotate(angle, Vec3{0, 0, 1})
}

// https://github.com/go-gl/mathgl/blob/v1.0.0/mgl32/transform.go#L159
func (m *Mat4) Rotate(angle float64, axis Vec3) *Mat4 {
// // quat := mgl32.Mat4ToQuat(mgl32.Mat4(*m))
Expand Down

0 comments on commit f68e2cb

Please sign in to comment.