fwgl-0.1.3.1: Game engine

Safe HaskellNone
LanguageHaskell2010

FWGL.Geometry

Synopsis

Documentation

data AttrList is where Source

A heterogeneous list of attributes.

Constructors

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

Instances

data Geometry is Source

A set of attributes and indices.

Constructors

Geometry (AttrList is) [Word16] Int 

Instances

type Geometry2D = `[Position2, UV]` Source

A 2D geometry.

type Geometry3D = `[Position3, UV, Normal3]` Source

A 3D geometry.

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

Create a custom Geometry.

mkGeometry2D Source

Arguments

:: GLES 
=> [Vec2]

List of vertices.

-> [Vec2]

List of UV coordinates.

-> [Word16]

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

-> Geometry Geometry2D 

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

mkGeometry3D Source

Arguments

:: GLES 
=> [Vec3]

List of vertices.

-> [Vec2]

List of UV coordinates.

-> [Vec3]

List of normals.

-> [Word16]

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

-> Geometry Geometry3D 

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

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