mirror of
https://github.com/bloeys/gglm.git
synced 2025-12-29 13:38:20 +00:00
Formatting
This commit is contained in:
16
gglm/quat.go
16
gglm/quat.go
@ -11,12 +11,12 @@ type Quat struct {
|
||||
Vec4
|
||||
}
|
||||
|
||||
//Eq checks for exact equality
|
||||
// Eq checks for exact equality
|
||||
func (q *Quat) Eq(q2 *Quat) bool {
|
||||
return q.Data == q2.Data
|
||||
}
|
||||
|
||||
//Angle returns the angle represented by this quaternion in radians
|
||||
// Angle returns the angle represented by this quaternion in radians
|
||||
func (q *Quat) Angle() float32 {
|
||||
|
||||
if Abs32(q.Data[3]) > CosHalf {
|
||||
@ -31,7 +31,7 @@ func (q *Quat) Angle() float32 {
|
||||
return Acos32(q.Data[3]) * 2
|
||||
}
|
||||
|
||||
//Axis returns the rotation axis represented by this quaternion
|
||||
// Axis returns the rotation axis represented by this quaternion
|
||||
func (q *Quat) Axis() *Vec3 {
|
||||
|
||||
var t float32 = 1 - q.Data[3]*q.Data[3]
|
||||
@ -47,8 +47,8 @@ func (q *Quat) Axis() *Vec3 {
|
||||
}}
|
||||
}
|
||||
|
||||
//Euler takes rotations in radians and produces a rotation that
|
||||
//rotates around the z-axis, y-axis and lastly x-axis.
|
||||
// Euler takes rotations in radians and produces a rotation that
|
||||
// rotates around the z-axis, y-axis and lastly x-axis.
|
||||
func NewQuatEuler(v *Vec3) *Quat {
|
||||
|
||||
//Some other common terminology: x=roll, y=pitch, z=yaw
|
||||
@ -74,8 +74,8 @@ func NewQuatEuler(v *Vec3) *Quat {
|
||||
}
|
||||
}
|
||||
|
||||
//Euler takes rotations in radians and produces a rotation that
|
||||
//rotates around the z-axis, y-axis and lastly x-axis.
|
||||
// Euler takes rotations in radians and produces a rotation that
|
||||
// rotates around the z-axis, y-axis and lastly x-axis.
|
||||
func NewQuatEulerXYZ(x, y, z float32) *Quat {
|
||||
|
||||
//Some other common terminology: x=roll, y=pitch, z=yaw
|
||||
@ -101,7 +101,7 @@ func NewQuatEulerXYZ(x, y, z float32) *Quat {
|
||||
}
|
||||
}
|
||||
|
||||
//NewQuatAngleAxis produces a quaternion thats rotates rotRad radians around the *normalized* vector rotAxisNorm
|
||||
// NewQuatAngleAxis produces a quaternion thats rotates rotRad radians around the *normalized* vector rotAxisNorm
|
||||
func NewQuatAngleAxis(rotRad float32, rotAxisNorm *Vec3) *Quat {
|
||||
|
||||
s, c := Sincos32(rotRad * 0.5)
|
||||
|
||||
Reference in New Issue
Block a user