struct Prism::Maths::Quaternion
- Prism::Maths::Quaternion
- Struct
- Value
- Object
Defined in:
prism/maths/quanternion.crConstructors
- .new(x : Float64, y : Float64, z : Float64, w : Float64)
- .new(axis : Vector3f, angle : Float32)
- .new(rot : Matrix4f)
Class Method Summary
-
.from_euler(euler : Vector3f)
Converts euler angles to Quaternion Angles are in radians!
- .lerp(qstart, qend : Quaternion, percent : Float64)
- .nlerp(qstart, qend : Quaternion, percent : Float64)
- .slerp(qstart, qend : Quaternion, percent : Float64)
-
.zero
Zero vector
Instance Method Summary
- #!=(other : Quaternion)
- #*(r : Quaternion)
- #*(other : Vector3f)
- #*(other : Float64)
- #**(other : Quaternion)
- #+(other : Quaternion)
- #-(other : Quaternion)
- #-
- #==(other : self)
- #==(r : Quaternion) : Bool
- #angle : Float64
- #angle=(v : Float64)
- #axis
- #axis=(v : Vector3f)
- #back
- #clone
- #conjugate
-
#dot(other : Quaternion)
Dot product
- #down
- #forward
- #inverse
- #left
- #length : Float32
- #magnitude
-
#nlerp(dest : Quaternion, lerp_factor : Float64, shortest : Bool) : Quaternion
Normalized linear interpolation.
- #norm
- #normalize
- #normalize!
- #pure?
- #right
- #set(x : Float64, y : Float64, z : Float64, w : Float64)
- #set(r : Quaternion)
-
#slerp(dest : Quaternion, lerp_factor : Float64, shortest : Bool) : Quaternion
Spherical linear interpolation.
- #to_euler
- #to_rotation_matrix
-
#to_s
Returns a nicely readable and concise string representation of this object, typically intended for users.
- #unit?
- #up
- #values
- #w : Float64
- #x : Float64
- #y : Float64
- #z : Float64
Constructor Detail
Class Method Detail
Converts euler angles to Quaternion Angles are in radians!
Instance Method Detail
Normalized linear interpolation.
This is technically cheaper than #slerp
however it's usually negligable.
For the most part you can choose whichever one looks best
Spherical linear interpolation.
This gives a guaranteed linear movement whereas #nlerp
does not.
This is technically more expensive than #nlerp
however it's usually negligable.
For the most part you can choose whichever one looks best
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO)
which can be overridden for custom implementations.
Also see #inspect
.