ombra-0.2.0.0: Render engine.

Safe HaskellNone
LanguageHaskell2010

Graphics.Rendering.Ombra.Geometry

Contents

Synopsis

Documentation

data Geometry is Source #

A set of attributes and indices.

Instances

Eq (Geometry is) Source # 

Methods

(==) :: Geometry is -> Geometry is -> Bool #

(/=) :: Geometry is -> Geometry is -> Bool #

Hashable (Geometry is) Source # 

Methods

hashWithSalt :: Int -> Geometry is -> Int #

hash :: Geometry is -> Int #

emptyGeometry Source #

Arguments

:: [Word16]

Triangles.

-> Geometry '[] 

Create a Geometry without attributes. You can add them using extend.

extend Source #

Arguments

:: (Attribute S i, Hashable (CPU S i), ShaderType i, GLES) 
=> (a -> i)

Attribute constructor (or any other function with that type).

-> [CPU S i]

List of values

-> Geometry is 
-> Geometry (i ': is) 

Add an attribute to a geometry.

remove Source #

Arguments

:: (RemoveAttr i is is', GLES) 
=> (a -> i)

Attribute constructor (or any other function with that type).

-> Geometry is 
-> Geometry is' 

Remove an attribute from a geometry.

2D and 3D geometries

type Geometry2D = '[Position2, UV] Source #

A 2D geometry.

type Geometry3D = '[Position3, UV, Normal3] Source #

A 3D 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.

positionOnly :: Geometry Geometry3D -> Geometry '[Position3] Source #

Remove the UV and Normal3 attributes from a 3D Geometry.