wavefront-0.2: Wavefront OBJ loader

Copyright(C) 2015 Dimitri Sabadie
LicenseBSD3
MaintainerDimitri Sabadie <[email protected]>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Codec.Wavefront.Object

Contents

Description

 

Synopsis

Context and elements

data Ctxt Source

The lexer context. The result of lexing a stream of tokens is this exact type.

Constructors

Ctxt 

Fields

ctxtLocations :: DList Location

Locations.

ctxtTexCoords :: DList TexCoord

Texture coordinates.

ctxtNormals :: DList Normal

Normals.

ctxtPoints :: DList (Element Point)

Points.

ctxtLines :: DList (Element Line)

Lines.

ctxtFaces :: DList (Element Face)

Faces.

ctxtCurrentObject :: Maybe Text

Current object.

ctxtCurrentGroups :: [Text]

Current groups.

ctxtCurrentMtl :: Maybe Text

Current material.

ctxtMtlLibs :: DList Text

Material libraries.

emptyCtxt :: Ctxt Source

The empty Ctxt. Such a context exists at the beginning of the token stream and gets altered as we consume tokens.

data Element a Source

An element holds a value along with the user-defined object’s name (if exists), the associated groups and the used material. Those values can be used to sort the data per object or per group and to lookup materials.

Constructors

Element 

Fields

elObject :: Maybe Text
 
elGroups :: [Text]
 
elMtl :: Maybe Text
 
elValue :: a
 

Instances

Eq a => Eq (Element a) Source 
Show a => Show (Element a) Source 

lexer :: TokenStream -> Ctxt Source

The lexer function, consuming tokens and yielding a Ctxt.

Wavefront OBJ

type WavefrontOBJ = Ctxt Source

Wavefront OBJ type.