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

Safe HaskellNone
LanguageHaskell2010

FWGL.Geometry

Synopsis

Documentation

data AttrList is where

A set of attributes and indices.

Constructors

AttrListNil :: AttrList [] 
AttrListCons :: (Hashable c, AttributeCPU c g) => g -> [c] -> AttrList gs -> AttrList (g : gs) 

Instances

data Geometry is

Constructors

Geometry (AttrList is) [Word16] Int 

Instances

type Geometry2 = `[Position2, UV]`

mkGeometry :: GLES => AttrList is -> [Word16] -> Geometry is

Create a custom Geometry.

mkGeometry2

Arguments

:: GLES 
=> [V2]

List of vertices.

-> [V2]

List of UV coordinates.

-> [Word16]

Triangles expressed as triples of indices to the two lists above.

-> Geometry Geometry2 

Create a 2D Geometry. The first two lists should have the same length.

mkGeometry3

Arguments

:: GLES 
=> [V3]

List of vertices.

-> [V2]

List of UV coordinates.

-> [V3]

List of normals.

-> [Word16]

Triangles expressed as triples of indices to the three lists above.

-> Geometry Geometry3 

Create a 3D Geometry. The first three lists should have the same length.

facesToArrays :: Vector V3 -> Vector V2 -> Vector V3 -> [[(Int, Int, Int)]] -> [(V3, V2, V3)]

triangulate :: [a] -> [(a, a, a)]