Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
Describe a rotation using Euler angles.
The contents of the Euler
structure are private
and should never be accessed directly.
Since: 1.2
Synopsis
- newtype Euler = Euler (ManagedPtr Euler)
- newZeroEuler :: MonadIO m => m Euler
- noEuler :: Maybe Euler
- eulerAlloc :: (HasCallStack, MonadIO m) => m Euler
- eulerEqual :: (HasCallStack, MonadIO m) => Euler -> Euler -> m Bool
- eulerFree :: (HasCallStack, MonadIO m) => Euler -> m ()
- eulerGetAlpha :: (HasCallStack, MonadIO m) => Euler -> m Float
- eulerGetBeta :: (HasCallStack, MonadIO m) => Euler -> m Float
- eulerGetGamma :: (HasCallStack, MonadIO m) => Euler -> m Float
- eulerGetOrder :: (HasCallStack, MonadIO m) => Euler -> m EulerOrder
- eulerGetX :: (HasCallStack, MonadIO m) => Euler -> m Float
- eulerGetY :: (HasCallStack, MonadIO m) => Euler -> m Float
- eulerGetZ :: (HasCallStack, MonadIO m) => Euler -> m Float
- eulerInit :: (HasCallStack, MonadIO m) => Euler -> Float -> Float -> Float -> m Euler
- eulerInitFromEuler :: (HasCallStack, MonadIO m) => Euler -> Maybe Euler -> m Euler
- eulerInitFromMatrix :: (HasCallStack, MonadIO m) => Euler -> Maybe Matrix -> EulerOrder -> m Euler
- eulerInitFromQuaternion :: (HasCallStack, MonadIO m) => Euler -> Maybe Quaternion -> EulerOrder -> m Euler
- eulerInitFromVec3 :: (HasCallStack, MonadIO m) => Euler -> Maybe Vec3 -> EulerOrder -> m Euler
- eulerInitWithOrder :: (HasCallStack, MonadIO m) => Euler -> Float -> Float -> Float -> EulerOrder -> m Euler
- eulerReorder :: (HasCallStack, MonadIO m) => Euler -> EulerOrder -> m Euler
- eulerToMatrix :: (HasCallStack, MonadIO m) => Euler -> m Matrix
- eulerToQuaternion :: (HasCallStack, MonadIO m) => Euler -> m Quaternion
- eulerToVec3 :: (HasCallStack, MonadIO m) => Euler -> m Vec3
Exported types
Memory-managed wrapper type.
Methods
Overloaded methods
alloc
:: (HasCallStack, MonadIO m) | |
=> m Euler | Returns: the newly allocated |
equal
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> Euler |
|
-> m Bool | Returns: |
Checks if two Euler
are equal.
Since: 1.2
free
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> m () |
Frees the resources allocated by eulerAlloc
.
Since: 1.2
getAlpha
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> m Float | Returns: the first component of the Euler angle vector, in radians |
Retrieves the first component of the Euler angle vector, depending on the order of rotation.
See also: eulerGetX
Since: 1.10
getBeta
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> m Float | Returns: the second component of the Euler angle vector, in radians |
Retrieves the second component of the Euler angle vector, depending on the order of rotation.
See also: eulerGetY
Since: 1.10
getGamma
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> m Float | Returns: the third component of the Euler angle vector, in radians |
Retrieves the third component of the Euler angle vector, depending on the order of rotation.
See also: eulerGetZ
Since: 1.10
getOrder
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> m EulerOrder | Returns: the order used to apply the rotations |
Retrieves the order used to apply the rotations described in the
Euler
structure, when converting to and from other
structures, like Quaternion
and Matrix
.
This function does not return the EulerOrderDefault
enumeration value; it will return the effective order of rotation
instead.
Since: 1.2
getX
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> m Float | Returns: the rotation angle |
Retrieves the rotation angle on the X axis, in degrees.
Since: 1.2
getY
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> m Float | Returns: the rotation angle |
Retrieves the rotation angle on the Y axis, in degrees.
Since: 1.2
getZ
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> m Float | Returns: the rotation angle |
Retrieves the rotation angle on the Z axis, in degrees.
Since: 1.2
init
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m Euler | Returns: the initialized |
Initializes a Euler
using the given angles.
The order of the rotations is EulerOrderDefault
.
Since: 1.2
initFromEuler
initFromMatrix
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> Maybe Matrix |
|
-> EulerOrder |
|
-> m Euler | Returns: the initialized |
initFromQuaternion
eulerInitFromQuaternion Source #
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> Maybe Quaternion |
|
-> EulerOrder |
|
-> m Euler | Returns: the initialized |
Initializes a Euler
using the given normalized quaternion.
If the Quaternion
q
is Nothing
, the Euler
will
be initialized with all angles set to 0.
Since: 1.2
initFromVec3
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> Maybe Vec3 |
|
-> EulerOrder |
|
-> m Euler | Returns: the initialized |
initWithOrder
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> EulerOrder |
|
-> m Euler | Returns: the initialized |
Initializes a Euler
with the given angles and order
.
Since: 1.2
reorder
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> EulerOrder |
|
-> m Euler |
Reorders a Euler
using order
.
This function is equivalent to creating a Quaternion
from the
given Euler
, and then converting the quaternion into another
Euler
.
Since: 1.2
toMatrix
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> m Matrix |
Converts a Euler
into a transformation matrix expressing
the extrinsic composition of rotations described by the Euler angles.
The rotations are applied over the reference frame axes in the order
associated with the Euler
; for instance, if the order
used to initialize e
is EulerOrderXyz
:
- the first rotation moves the body around the X axis with an angle φ
- the second rotation moves the body around the Y axis with an angle of ϑ
- the third rotation moves the body around the Z axis with an angle of ψ
The rotation sign convention is right-handed, to preserve compatibility between Euler-based, quaternion-based, and angle-axis-based rotations.
Since: 1.2
toQuaternion
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> m Quaternion |
Converts a Euler
into a Quaternion
.
Since: 1.10
toVec3
:: (HasCallStack, MonadIO m) | |
=> Euler |
|
-> m Vec3 |