collada-types-0.3: Data exchange between graphic applications

Synopsis

# Documentation

type Angle = FloatSource

An angle is a number between -pi and pi.

data V2 Source

2D vector: a pair of coordinates.

Constructors

 V !Float !Float

Instances

 Eq V2 Num V2 Ord V2 Show V2

data V3 Source

Constructors

 V3 !Float !Float !Float

Instances

 Eq V3 Num V3 Ord V3 Show V3

data V4 Source

Constructors

 V4 !Float !Float !Float !Float

Instances

 Eq V4 Ord V4 Show V4

data T2 Source

2D affine transformation. No shearing allowed, only translation, rotation, and scaling. Transformations can be chained with `mappend`, and `mempty` is the identity transformation.

Instances

 Show T2 Monoid T2

Unit vector with the given direction.

(*.) :: V2 -> Float -> V2Source

Multiplication with a scalar.

dot :: V2 -> V2 -> FloatSource

Multiplication with a scalar.

Division by a scalar.

Dot product.

dot3 :: V3 -> V3 -> FloatSource

Dot product.

cross :: V2 -> V2 -> FloatSource

Perp-dot product (2D cross product).

cross3 :: V3 -> V3 -> V3Source

3D cross product.

perpL :: V2 -> V2Source

Vector rotated 90 degrees leftwards.

perpR :: V2 -> V2Source

Vector rotated 90 degrees rightwards.

mul :: V3 -> Float -> V3Source

turn :: V2 -> V2 -> OrderingSource

Relative direction of two vectors: `turn v1 v2` equals `GT` if `v2` takes a left turn with respect to `v1`, `LT` if it is a right turn, and `EQ` if they are parallel.

turnL :: V2 -> V2 -> BoolSource

`turnL v1 v2 == (turn v1 v2 == GT)`

turnNL :: V2 -> V2 -> BoolSource

`turnNL v1 v2 == (turn v1 v2 /= GT)`

turnR :: V2 -> V2 -> BoolSource

`turnR v1 v2 == (turn v1 v2 == LT)`

turnNR :: V2 -> V2 -> BoolSource

`turnNR v1 v2 == (turn v1 v2 /= LT)`

parv :: V2 -> V2 -> BoolSource

`parv v1 v2 == (turn v1 v2 == EQ)`

Vector length squared.

mag :: V2 -> FloatSource

Vector length.

norm :: V2 -> V2Source

Vector normalisation.

dir :: V2 -> AngleSource

3d Vector length.

Set Vector length.

The angle of a vector with respect to the X axis.

Inverse transformation

(<>) :: T2 -> V2 -> V2Source

Transformation applied to a vector.

Transformation representing a translation.

Transformation representing a rotation.

Transformation representing a scaling.

The translation factor of a transformation.

The rotation factor of a transformation.

The scaling factor of a transformation.

Replacing the translation factor of a transformation.

Replacing the rotation factor of a transformation.

withScale :: T2 -> Float -> T2Source

Replacing the scaling factor of a transformation.