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

Safe HaskellSafe
LanguageHaskell2010

FWGL.Vector

Synopsis

Documentation

data V4 Source

Four-dimensional vector.

Constructors

V4 !Float !Float !Float !Float 

data M2 Source

2x2 matrix.

Constructors

M2 !V2 !V2 

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.

dot4 :: V4 -> V4 -> Float Source

4D vector dot product.

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.

orthoMat4 Source

Arguments

:: Float

Far

-> Float

Near

-> Float

Left

-> Float

Right

-> Float

Bottom

-> Float

Top

-> M4 

4x4 orthographic projection matrix.

perspectiveMat4 Source

Arguments

:: Float

Far

-> Float

Near

-> Float

FOV

-> Float

Aspect ratio

-> M4 

4x4 perspective projection matrix.

cameraMat4 Source

Arguments

:: V3

Eye

-> Float

Pitch

-> Float

Yaw

-> M4 

4x4 FPS camera 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.