gore-and-ash-1.1.0.1: Core of FRP game engine called Gore&Ash

Copyright(c) Anton Gushcha, 2015-2016 Oganyan Levon, 2016
LicenseBSD3
Maintainerncrashed@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Game.GoreAndAsh.Math

Contents

Description

Defines common math transformations for world, camera, vieport spaces.

Synopsis

3D matrix transformations

scale :: Num a => V3 a -> M44 a Source

Scale matrix for 3D transformation

rotationZ :: Floating a => a -> M44 a Source

Rotation around Z axis for 3D transformation

translate :: Num a => V3 a -> M44 a Source

Translation matrix for 3D transformation

2D matrix transformations

scale2D :: Num a => V2 a -> M33 a Source

Scale matrix for 2D transformation

rotation2D :: Floating a => a -> M33 a Source

Rotation matrix for 2D transformation

translate2D :: Num a => V2 a -> M33 a Source

Translation matrix for 2D transformation

toHom2D :: Num a => V2 a -> V3 a Source

Transform to homogenius coordinates

fromHom2D :: Floating a => V3 a -> V2 a Source

Transform from homogenius coordinates

applyTransform2D :: Floating a => M33 a -> V2 a -> V2 a Source

Applies transformation matrix to vector

viewportTransform2D Source

Arguments

:: Floating a 
=> V2 a

Viewport left top corner

-> V2 a

Viewport right bottom corner

-> M33 a 

Viewport transformation matrix