geomancy-0.3.0.0: Vectors and matrix manipulation
Safe HaskellNone
LanguageHaskell2010

Geomancy.Quaternion

Description

Specialized and inlined Quaternion Float.

Synopsis

Documentation

data Quaternion Source #

Instances

Instances details
Storable Quaternion Source # 
Instance details

Defined in Geomancy.Quaternion

Num Quaternion Source # 
Instance details

Defined in Geomancy.Quaternion

Show Quaternion Source # 
Instance details

Defined in Geomancy.Quaternion

NFData Quaternion Source # 
Instance details

Defined in Geomancy.Quaternion

Methods

rnf :: Quaternion -> () #

Eq Quaternion Source # 
Instance details

Defined in Geomancy.Quaternion

Ord Quaternion Source # 
Instance details

Defined in Geomancy.Quaternion

Block Quaternion Source # 
Instance details

Defined in Geomancy.Quaternion

Associated Types

type PackedSize Quaternion 
Instance details

Defined in Geomancy.Quaternion

type PackedSize Quaternion Source # 
Instance details

Defined in Geomancy.Quaternion

withQuaternion :: Quaternion -> (Float -> Float -> Float -> Float -> r) -> r Source #

axisAngle :: Vec3 -> Float -> Quaternion Source #

Quaternion construction from axis and angle.

In a right-handed system, the rotation would appear clockwise when looking in the axis direction.

rotate :: Quaternion -> Vec3 -> Vec3 Source #

Rotate point with a unit quaternion.

rotatePoint :: Quaternion -> Vec3 -> Vec3 -> Vec3 Source #

Rotate point around another point with a unit quaternion.

rotationBetween :: Vec3 -> Vec3 -> Quaternion Source #

Rotation between vectors.

(in other words: the quaternion needed to rotate v1 so that it matches v2)

lookAtUp :: Vec3 -> Vec3 -> Vec3 -> Quaternion Source #

Orient towards a point.

Use "rotationBetween" if you don't need to keep the object upright.