GPipe-Collada-0.1.0: Load GPipe meshes from Collada filesSource codeContentsIndex
Graphics.GPipe.Collada
Description

This module contains the data types of the Collada scene graph.

Orphan TypeableX instances are also provided for Vertex and Data.Vec vectors (:.) .

Synopsis
type Scene = Tree (SID, Node)
data Node = Node {
nodeId :: Maybe ID
nodeLayers :: [String]
nodeTransformations :: [(SID, Transform)]
nodeCameras :: [(SID, Camera)]
nodeLights :: [(SID, Light)]
nodeGeometries :: [(SID, Geometry)]
}
nodeMat :: Node -> Mat44 Float
nodeAABB :: Node -> AABB
data Transform
= LookAt {
lookAtEye :: Vec3 Float
lookAtInterest :: Vec3 Float
lookAtUp :: Vec3 Float
}
| Matrix (Mat44 Float)
| Rotate (Vec3 Float) Float
| Scale (Vec3 Float)
| Skew {
skewAngle :: Float
skewRotation :: Vec3 Float
skewTranslation :: Vec3 Float
}
| Translate (Vec3 Float)
transformMat :: Transform -> Mat44 Float
transformsMat :: [Transform] -> Mat44 Float
data Camera
= Perspective {
perspectiveID :: ID
perspectiveFov :: ViewSize
perspectiveZ :: Z
}
| Orthographic {
orthographicID :: ID
orthographicViewSize :: ViewSize
orthographicZ :: Z
}
cameraMat :: Float -> Camera -> Mat44 Float
data ViewSize
= ViewSizeX Float
| ViewSizeY Float
| ViewSizeXY (Vec2 Float)
data Z = Z {
zNear :: Float
zFar :: Float
}
data Light
= Ambient {
ambientID :: ID
ambientColor :: Color RGBFormat Float
}
| Directional {
directionalID :: ID
directionalColor :: Color RGBFormat Float
}
| Point {
pointID :: ID
pointColor :: Color RGBFormat Float
pointAttenuation :: Attenuation
}
| Spot {
spotID :: ID
spotColor :: Color RGBFormat Float
spotAttenuation :: Attenuation
spotFallOffAngle :: Float
spotFallOffExponent :: Float
}
data Attenuation = Attenuation {
attenuationConstant :: Float
attenuationLinear :: Float
attenuationQuadratic :: Float
}
data Geometry = Mesh {
meshID :: ID
meshPrimitives :: [Mesh]
}
data Mesh = TriangleMesh {
meshMaterial :: String
meshDescription :: Map Semantic TypeRep
meshPrimitiveStream :: PrimitiveStream Triangle (Map Semantic Dynamic)
meshAABB :: AABB
}
type ID = String
type SID = Maybe String
type Semantic = String
data AABB = AABB {
aabbMin :: Vec3 Float
aabbMax :: Vec3 Float
}
Documentation
type Scene = Tree (SID, Node)Source
data Node Source
Constructors
Node
nodeId :: Maybe ID
nodeLayers :: [String]
nodeTransformations :: [(SID, Transform)]
nodeCameras :: [(SID, Camera)]
nodeLights :: [(SID, Light)]
nodeGeometries :: [(SID, Geometry)]
show/hide Instances
nodeMat :: Node -> Mat44 FloatSource
The complete transform matrix of all Transform elements in a node.
nodeAABB :: Node -> AABBSource
The smallest AABB that contains all Geometry elements in a node. Note: This is not transformed using the nodes Transform elements.
data Transform Source
Constructors
LookAt
lookAtEye :: Vec3 Float
lookAtInterest :: Vec3 Float
lookAtUp :: Vec3 Float
Matrix (Mat44 Float)
Rotate (Vec3 Float) Float
Scale (Vec3 Float)
Skew
skewAngle :: Float
skewRotation :: Vec3 Float
skewTranslation :: Vec3 Float
Translate (Vec3 Float)
show/hide Instances
transformMat :: Transform -> Mat44 FloatSource
Gets the transformation matrix of a Transform element.
transformsMat :: [Transform] -> Mat44 FloatSource
Gets the total transformation matrix of a list of Transform element.
data Camera Source
Constructors
Perspective
perspectiveID :: ID
perspectiveFov :: ViewSize
perspectiveZ :: Z
Orthographic
orthographicID :: ID
orthographicViewSize :: ViewSize
orthographicZ :: Z
show/hide Instances
cameraMat :: Float -> Camera -> Mat44 FloatSource
Gets the projection matrix of a Camera element.
data ViewSize Source
Constructors
ViewSizeX Float
ViewSizeY Float
ViewSizeXY (Vec2 Float)
show/hide Instances
data Z Source
Constructors
Z
zNear :: Float
zFar :: Float
show/hide Instances
data Light Source
Constructors
Ambient
ambientID :: ID
ambientColor :: Color RGBFormat Float
Directional
directionalID :: ID
directionalColor :: Color RGBFormat Float
Point
pointID :: ID
pointColor :: Color RGBFormat Float
pointAttenuation :: Attenuation
Spot
spotID :: ID
spotColor :: Color RGBFormat Float
spotAttenuation :: Attenuation
spotFallOffAngle :: Float
spotFallOffExponent :: Float
show/hide Instances
data Attenuation Source
Constructors
Attenuation
attenuationConstant :: Float
attenuationLinear :: Float
attenuationQuadratic :: Float
show/hide Instances
data Geometry Source
Constructors
Mesh
meshID :: ID
meshPrimitives :: [Mesh]
show/hide Instances
data Mesh Source
Constructors
TriangleMesh
meshMaterial :: String
meshDescription :: Map Semantic TypeRep
meshPrimitiveStream :: PrimitiveStream Triangle (Map Semantic Dynamic)
meshAABB :: AABB
show/hide Instances
type ID = StringSource
type SID = Maybe StringSource
type Semantic = StringSource
data AABB Source
An axis aligned bounding box.
Constructors
AABB
aabbMin :: Vec3 Float
aabbMax :: Vec3 Float
show/hide Instances
Produced by Haddock version 2.7.2