gi-graphene-1.0.8: Graphene bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Graphene.Structs.Euler

Contents

- Exported types
- Methods
  - alloc
  - equal
  - free
  - getAlpha
  - getBeta
  - getGamma
  - getOrder
  - getX
  - getY
  - getZ
  - init
  - initFromEuler
  - initFromMatrix
  - initFromQuaternion
  - initFromRadians
  - initFromVec3
  - initWithOrder
  - reorder
  - toMatrix
  - toQuaternion
  - toVec3

Description

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
- 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
- eulerInitFromRadians :: (HasCallStack, MonadIO m) => Euler -> Float -> Float -> Float -> 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

newtype Euler Source #

Memory-managed wrapper type.

Constructors

Euler (ManagedPtr Euler) |

#### Instances

Instances details

Eq Euler Source # |
Instance details Defined in GI.Graphene.Structs.Euler Methods (==) :: Euler -> Euler -> Bool Source # (/=) :: Euler -> Euler -> Bool Source #
GBoxed Euler Source # |
Instance details Defined in GI.Graphene.Structs.Euler
ManagedPtrNewtype Euler Source # |
Instance details Defined in GI.Graphene.Structs.Euler Methods toManagedPtr :: Euler -> ManagedPtr Euler Source #
TypedObject Euler Source # |
Instance details Defined in GI.Graphene.Structs.Euler Methods glibType :: IO GType Source #
HasParentTypes Euler Source # |
Instance details Defined in GI.Graphene.Structs.Euler
tag ~ 'AttrSet => Constructible Euler tag Source # |
Instance details Defined in GI.Graphene.Structs.Euler Methods new :: MonadIO m => (ManagedPtr Euler -> Euler) -> [AttrOp Euler tag] -> m Euler Source #
IsGValue (Maybe Euler) Source # | Convert `Euler` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Graphene.Structs.Euler Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Euler -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Euler) Source #
type ParentTypes Euler Source # |
Instance details Defined in GI.Graphene.Structs.Euler type ParentTypes Euler = '[] :: [Type]

newZeroEuler :: MonadIO m => m Euler Source #

Construct a `Euler` struct initialized to zero.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

equal, free, init, initFromEuler, initFromMatrix, initFromQuaternion, initFromRadians, initFromVec3, initWithOrder, reorder, toMatrix, toQuaternion, toVec3.

#### Getters

getAlpha, getBeta, getGamma, getOrder, getX, getY, getZ.

#### Setters

None.

## alloc

eulerAlloc Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Euler | Returns: the newly allocated `Euler`

Allocates a new `Euler`.

The contents of the returned structure are undefined.

Since: 1.2

## equal

eulerEqual Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `a`: a `Euler`
-> Euler | `b`: a `Euler`
-> m Bool | Returns: `true` if the two `Euler` are equal

Checks if two `Euler` are equal.

Since: 1.2

## free

eulerFree Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `Euler`
-> m () |

Frees the resources allocated by `eulerAlloc`.

Since: 1.2

## getAlpha

eulerGetAlpha Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `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

eulerGetBeta Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `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

eulerGetGamma Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `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

eulerGetOrder Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `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

eulerGetX Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `Euler`
-> m Float | Returns: the rotation angle

Retrieves the rotation angle on the X axis, in degrees.

Since: 1.2

## getY

eulerGetY Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `Euler`
-> m Float | Returns: the rotation angle

Retrieves the rotation angle on the Y axis, in degrees.

Since: 1.2

## getZ

eulerGetZ Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `Euler`
-> m Float | Returns: the rotation angle

Retrieves the rotation angle on the Z axis, in degrees.

Since: 1.2

## init

eulerInit Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: the `Euler` to initialize
-> Float | `x`: rotation angle on the X axis, in degrees
-> Float | `y`: rotation angle on the Y axis, in degrees
-> Float | `z`: rotation angle on the Z axis, in degrees
-> m Euler | Returns: the initialized `Euler`

Initializes a `Euler` using the given angles.

The order of the rotations is `EulerOrderDefault`.

Since: 1.2

## initFromEuler

eulerInitFromEuler Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: the `Euler` to initialize
-> Maybe Euler | `src`: a `Euler`
-> m Euler | Returns: the initialized `Euler`

Initializes a `Euler` using the angles and order of another `Euler`.

If the `Euler` `src` is `Nothing`, this function is equivalent to calling `eulerInit` with all angles set to 0.

Since: 1.2

## initFromMatrix

eulerInitFromMatrix Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: the `Euler` to initialize
-> Maybe Matrix | `m`: a rotation matrix
-> EulerOrder | `order`: the order used to apply the rotations
-> m Euler | Returns: the initialized `Euler`

Initializes a `Euler` using the given rotation matrix.

If the `Matrix` `m` is `Nothing`, the `Euler` will be initialized with all angles set to 0.

Since: 1.2

## initFromQuaternion

eulerInitFromQuaternion Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `Euler`
-> Maybe Quaternion | `q`: a normalized `Quaternion`
-> EulerOrder | `order`: the order used to apply the rotations
-> m Euler | Returns: the initialized `Euler`

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

## initFromRadians

eulerInitFromRadians Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: the `Euler` to initialize
-> Float | `x`: rotation angle on the X axis, in radians
-> Float | `y`: rotation angle on the Y axis, in radians
-> Float | `z`: rotation angle on the Z axis, in radians
-> EulerOrder | `order`: order of rotations
-> m Euler | Returns: the initialized `Euler`

Initializes a `Euler` using the given angles and order of rotation.

Since: 1.10

## initFromVec3

eulerInitFromVec3 Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: the `Euler` to initialize
-> Maybe Vec3 | `v`: a `Vec3` containing the rotation angles in degrees
-> EulerOrder | `order`: the order used to apply the rotations
-> m Euler | Returns: the initialized `Euler`

Initializes a `Euler` using the angles contained in a `Vec3`.

If the `Vec3` `v` is `Nothing`, the `Euler` will be initialized with all angles set to 0.

Since: 1.2

## initWithOrder

eulerInitWithOrder Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: the `Euler` to initialize
-> Float | `x`: rotation angle on the X axis, in degrees
-> Float | `y`: rotation angle on the Y axis, in degrees
-> Float | `z`: rotation angle on the Z axis, in degrees
-> EulerOrder | `order`: the order used to apply the rotations
-> m Euler | Returns: the initialized `Euler`

Initializes a `Euler` with the given angles and `order`.

Since: 1.2

## reorder

eulerReorder Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `Euler`
-> EulerOrder | `order`: the new order
-> 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

eulerToMatrix Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `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

eulerToQuaternion Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `Euler`
-> m Quaternion |

Converts a `Euler` into a `Quaternion`.

Since: 1.10

## toVec3

eulerToVec3 Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Euler | `e`: a `Euler`
-> m Vec3 |

Retrieves the angles of a `Euler` and initializes a `Vec3` with them.

Since: 1.2