collada-types-0.4: Data exchange between graphics applications

Safe HaskellSafe
LanguageHaskell98

Graphics.Formats.Collada.Vector2D3D

Synopsis

Documentation

type Angle = Float Source #

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 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

(==) :: V2 -> V2 -> Bool #

(/=) :: V2 -> V2 -> Bool #

Num V2 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

(+) :: V2 -> V2 -> V2 #

(-) :: V2 -> V2 -> V2 #

(*) :: V2 -> V2 -> V2 #

negate :: V2 -> V2 #

abs :: V2 -> V2 #

signum :: V2 -> V2 #

fromInteger :: Integer -> V2 #

Ord V2 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

compare :: V2 -> V2 -> Ordering #

(<) :: V2 -> V2 -> Bool #

(<=) :: V2 -> V2 -> Bool #

(>) :: V2 -> V2 -> Bool #

(>=) :: V2 -> V2 -> Bool #

max :: V2 -> V2 -> V2 #

min :: V2 -> V2 -> V2 #

Show V2 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

showsPrec :: Int -> V2 -> ShowS #

show :: V2 -> String #

showList :: [V2] -> ShowS #

data V3 Source #

Constructors

V3 !Float !Float !Float 
Instances
Eq V3 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

(==) :: V3 -> V3 -> Bool #

(/=) :: V3 -> V3 -> Bool #

Num V3 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

(+) :: V3 -> V3 -> V3 #

(-) :: V3 -> V3 -> V3 #

(*) :: V3 -> V3 -> V3 #

negate :: V3 -> V3 #

abs :: V3 -> V3 #

signum :: V3 -> V3 #

fromInteger :: Integer -> V3 #

Ord V3 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

compare :: V3 -> V3 -> Ordering #

(<) :: V3 -> V3 -> Bool #

(<=) :: V3 -> V3 -> Bool #

(>) :: V3 -> V3 -> Bool #

(>=) :: V3 -> V3 -> Bool #

max :: V3 -> V3 -> V3 #

min :: V3 -> V3 -> V3 #

Show V3 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

showsPrec :: Int -> V3 -> ShowS #

show :: V3 -> String #

showList :: [V3] -> ShowS #

data V4 Source #

Constructors

V4 !Float !Float !Float !Float 
Instances
Eq V4 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

(==) :: V4 -> V4 -> Bool #

(/=) :: V4 -> V4 -> Bool #

Ord V4 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

compare :: V4 -> V4 -> Ordering #

(<) :: V4 -> V4 -> Bool #

(<=) :: V4 -> V4 -> Bool #

(>) :: V4 -> V4 -> Bool #

(>=) :: V4 -> V4 -> Bool #

max :: V4 -> V4 -> V4 #

min :: V4 -> V4 -> V4 #

Show V4 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

showsPrec :: Int -> V4 -> ShowS #

show :: V4 -> String #

showList :: [V4] -> ShowS #

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 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

showsPrec :: Int -> T2 -> ShowS #

show :: T2 -> String #

showList :: [T2] -> ShowS #

Semigroup T2 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

(<>) :: T2 -> T2 -> T2 #

sconcat :: NonEmpty T2 -> T2 #

stimes :: Integral b => b -> T2 -> T2 #

Monoid T2 Source # 
Instance details

Defined in Graphics.Formats.Collada.Vector2D3D

Methods

mempty :: T2 #

mappend :: T2 -> T2 -> T2 #

mconcat :: [T2] -> T2 #

unit :: Angle -> V2 Source #

Unit vector with the given direction.

(*.) :: V2 -> Float -> V2 Source #

Multiplication with a scalar.

dot :: V2 -> V2 -> Float infixl 7 Source #

Dot product.

dot3 :: V3 -> V3 -> Float Source #

Dot product.

cross :: V2 -> V2 -> Float infixl 7 Source #

Perp-dot product (2D cross product).

cross3 :: V3 -> V3 -> V3 Source #

3D cross product.

perpL :: V2 -> V2 Source #

Vector rotated 90 degrees leftwards.

perpR :: V2 -> V2 Source #

Vector rotated 90 degrees rightwards.

mul :: V3 -> Float -> V3 Source #

Multiplication with a scalar.

divide :: V3 -> Float -> V3 Source #

Division by a scalar.

turn :: V2 -> V2 -> Ordering infixl 5 Source #

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 -> Bool infixl 5 Source #

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

turnNL :: V2 -> V2 -> Bool infixl 5 Source #

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

turnR :: V2 -> V2 -> Bool infixl 5 Source #

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

turnNR :: V2 -> V2 -> Bool infixl 5 Source #

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

parv :: V2 -> V2 -> Bool infixl 5 Source #

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

square :: V2 -> Float Source #

Vector length squared.

mag :: V2 -> Float Source #

Vector length.

norm :: V2 -> V2 Source #

Vector normalisation.

dir :: V2 -> Angle Source #

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

v_len :: V3 -> Float Source #

3d Vector length.

set_len :: V3 -> Float -> V3 Source #

Set Vector length.

inverse :: T2 -> T2 Source #

Inverse transformation

(<>) :: Semigroup a => a -> a -> a infixr 6 #

An associative operation.

translate :: V2 -> T2 Source #

Transformation representing a translation.

rotate :: Angle -> T2 Source #

Transformation representing a rotation.

scale :: Float -> T2 Source #

Transformation representing a scaling.

translationOf :: T2 -> V2 Source #

The translation factor of a transformation.

rotationOf :: T2 -> Angle Source #

The rotation factor of a transformation.

scaleOf :: T2 -> Float Source #

The scaling factor of a transformation.

withTranslation :: T2 -> V2 -> T2 Source #

Replacing the translation factor of a transformation.

withRotation :: T2 -> Angle -> T2 Source #

Replacing the rotation factor of a transformation.

withScale :: T2 -> Float -> T2 Source #

Replacing the scaling factor of a transformation.