fwgl-0.1.0.2: FRP 2D/3D game engine

Safe HaskellSafe-Inferred
LanguageHaskell2010

FWGL.Vector

Synopsis

Documentation

data V2 Source

Two-dimensional vector.

Constructors

V2 !Float !Float 

data V3 Source

Three-dimensional vector.

Constructors

V3 !Float !Float !Float 

data V4 Source

Four-dimensional vector.

Constructors

V4 !Float !Float !Float !Float 

data M2 Source

2x2 matrix.

Constructors

M2 !V2 !V2 

Instances

data M3 Source

3x3 matrix.

Constructors

M3 !V3 !V3 !V3 

data M4 Source

4x4 matrix.

Constructors

M4 !V4 !V4 !V4 !V4 

vec2 :: (Float, Float) -> V2 Source

Create a two-dimensional vector.

vec3 :: (Float, Float, Float) -> V3 Source

Create a three-dimensional vector.

vec4 :: (Float, Float, Float, Float) -> V4 Source

Create a four-dimensional vector.

mat2 :: (Float, Float, Float, Float) -> M2 Source

Create a 2x2 matrix.

mat3 :: (Float, Float, Float, Float, Float, Float, Float, Float, Float) -> M3 Source

Create a 3x3 matrix.

mul3 :: M3 -> M3 -> M3 Source

3x3 matrix multiplication.

mul4 :: M4 -> M4 -> M4 Source

4x4 matrix multiplication.

transpose4 :: M4 -> M4 Source

Transpose a 4x4 matrix.

idMat4 :: M4 Source

4x4 identity matrix.

transMat4 :: V3 -> M4 Source

4x4 translation matrix.

rotXMat4 :: Float -> M4 Source

4x4 rotation matrix (X axis).

rotYMat4 :: Float -> M4 Source

4x4 rotation matrix (Y axis).

rotZMat4 :: Float -> M4 Source

4x4 rotation matrix (Z axis).

rotAAMat4 Source

Arguments

:: V3

Axis.

-> Float

Angle

-> M4 

4x4 rotation matrix.

scaleMat4 :: V3 -> M4 Source

4x4 scale matrix.

perspectiveMat4 Source

Arguments

:: Float

Far

-> Float

Near

-> Float

FOV

-> Float

Aspect ratio

-> M4 

4x4 perspective matrix.

idMat3 :: M3 Source

The identity 3x3 matrix.

transMat3 :: V2 -> M3 Source

3x3 translation matrix.

rotMat3 :: Float -> M3 Source

3x3 rotation matrix.

scaleMat3 :: V2 -> M3 Source

3x3 scale matrix.