gi-graphene-1.0.8: Graphene bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Graphene.Structs.Quaternion

Description

A quaternion.

The contents of the Quaternion structure are private and should never be accessed directly.

Since: 1.0

Synopsis

Exported types

newtype Quaternion Source #

Memory-managed wrapper type.

Constructors

Quaternion (ManagedPtr Quaternion) 

Instances

Instances details
Eq Quaternion Source # 
Instance details

Defined in GI.Graphene.Structs.Quaternion

GBoxed Quaternion Source # 
Instance details

Defined in GI.Graphene.Structs.Quaternion

ManagedPtrNewtype Quaternion Source # 
Instance details

Defined in GI.Graphene.Structs.Quaternion

Methods

toManagedPtr :: Quaternion -> ManagedPtr Quaternion

TypedObject Quaternion Source # 
Instance details

Defined in GI.Graphene.Structs.Quaternion

Methods

glibType :: IO GType

HasParentTypes Quaternion Source # 
Instance details

Defined in GI.Graphene.Structs.Quaternion

tag ~ 'AttrSet => Constructible Quaternion tag Source # 
Instance details

Defined in GI.Graphene.Structs.Quaternion

Methods

new :: MonadIO m => (ManagedPtr Quaternion -> Quaternion) -> [AttrOp Quaternion tag] -> m Quaternion

IsGValue (Maybe Quaternion) Source #

Convert Quaternion to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Graphene.Structs.Quaternion

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Quaternion -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Quaternion)

type ParentTypes Quaternion Source # 
Instance details

Defined in GI.Graphene.Structs.Quaternion

type ParentTypes Quaternion = '[] :: [Type]

newZeroQuaternion :: MonadIO m => m Quaternion Source #

Construct a Quaternion struct initialized to zero.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

add, dot, equal, free, init, initFromAngleVec3, initFromAngles, initFromEuler, initFromMatrix, initFromQuaternion, initFromRadians, initFromVec4, initIdentity, invert, multiply, normalize, scale, slerp, toAngleVec3, toAngles, toMatrix, toRadians, toVec4.

Getters

None.

Setters

None.

add

quaternionAdd Source #

Adds two Quaternion a and b.

Since: 1.10

alloc

quaternionAlloc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Quaternion

Returns: the newly allocated Quaternion

Allocates a new Quaternion.

The contents of the returned value are undefined.

Since: 1.0

dot

quaternionDot Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

a: a Quaternion

-> Quaternion

b: a Quaternion

-> m Float

Returns: the value of the dot products

Computes the dot product of two Quaternion.

Since: 1.0

equal

quaternionEqual Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

a: a Quaternion

-> Quaternion

b: a Quaternion

-> m Bool

Returns: true if the quaternions are equal

Checks whether the given quaternions are equal.

Since: 1.0

free

quaternionFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> m () 

Releases the resources allocated by quaternionAlloc.

Since: 1.0

init

quaternionInit Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> Float

x: the first component of the quaternion

-> Float

y: the second component of the quaternion

-> Float

z: the third component of the quaternion

-> Float

w: the fourth component of the quaternion

-> m Quaternion

Returns: the initialized quaternion

Initializes a Quaternion using the given four values.

Since: 1.0

initFromAngleVec3

quaternionInitFromAngleVec3 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> Float

angle: the rotation on a given axis, in degrees

-> Vec3

axis: the axis of rotation, expressed as a vector

-> m Quaternion

Returns: the initialized quaternion

Initializes a Quaternion using an angle on a specific axis.

Since: 1.0

initFromAngles

quaternionInitFromAngles Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> Float

degX: rotation angle on the X axis (yaw), in degrees

-> Float

degY: rotation angle on the Y axis (pitch), in degrees

-> Float

degZ: rotation angle on the Z axis (roll), in degrees

-> m Quaternion

Returns: the initialized quaternion

Initializes a Quaternion using the values of the Euler angles on each axis.

See also: quaternionInitFromEuler

Since: 1.0

initFromEuler

quaternionInitFromEuler Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: the Quaternion to initialize

-> Euler

e: a Euler

-> m Quaternion

Returns: the initialized Quaternion

Initializes a Quaternion using the given Euler.

Since: 1.2

initFromMatrix

quaternionInitFromMatrix Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> Matrix

m: a Matrix

-> m Quaternion

Returns: the initialized quaternion

Initializes a Quaternion using the rotation components of a transformation matrix.

Since: 1.0

initFromQuaternion

quaternionInitFromQuaternion Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> Quaternion

src: a Quaternion

-> m Quaternion

Returns: the initialized quaternion

Initializes a Quaternion with the values from src.

Since: 1.0

initFromRadians

quaternionInitFromRadians Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> Float

radX: rotation angle on the X axis (yaw), in radians

-> Float

radY: rotation angle on the Y axis (pitch), in radians

-> Float

radZ: rotation angle on the Z axis (roll), in radians

-> m Quaternion

Returns: the initialized quaternion

Initializes a Quaternion using the values of the Euler angles on each axis.

See also: quaternionInitFromEuler

Since: 1.0

initFromVec4

quaternionInitFromVec4 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> Vec4

src: a Vec4

-> m Quaternion

Returns: the initialized quaternion

Initializes a Quaternion with the values from src.

Since: 1.0

initIdentity

quaternionInitIdentity Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> m Quaternion

Returns: the initialized quaternion

Initializes a Quaternion using the identity transformation.

Since: 1.0

invert

quaternionInvert Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> m Quaternion 

Inverts a Quaternion, and returns the conjugate quaternion of q.

Since: 1.0

multiply

quaternionMultiply Source #

Multiplies two Quaternion a and b.

Since: 1.10

normalize

quaternionNormalize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> m Quaternion 

Normalizes a Quaternion.

Since: 1.0

scale

quaternionScale Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> Float

factor: a scaling factor

-> m Quaternion 

Scales all the elements of a Quaternion q using the given scalar factor.

Since: 1.10

slerp

quaternionSlerp Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

a: a Quaternion

-> Quaternion

b: a Quaternion

-> Float

factor: the linear interpolation factor

-> m Quaternion 

Interpolates between the two given quaternions using a spherical linear interpolation, or SLERP, using the given interpolation factor.

Since: 1.0

toAngleVec3

quaternionToAngleVec3 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> m (Float, Vec3) 

Converts a quaternion into an angle, axis pair.

Since: 1.0

toAngles

quaternionToAngles Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> m (Float, Float, Float) 

Converts a Quaternion to its corresponding rotations on the Euler angles on each axis.

Since: 1.2

toMatrix

quaternionToMatrix Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> m Matrix 

Converts a quaternion into a transformation matrix expressing the rotation defined by the Quaternion.

Since: 1.0

toRadians

quaternionToRadians Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> m (Float, Float, Float) 

Converts a Quaternion to its corresponding rotations on the Euler angles on each axis.

Since: 1.2

toVec4

quaternionToVec4 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Quaternion

q: a Quaternion

-> m Vec4 

Copies the components of a Quaternion into a Vec4.

Since: 1.0