This module contains the data types of the Collada scene graph.
- topDown :: (acc -> x -> (acc, y)) -> acc -> Tree x -> Tree y
- bottomUp :: ([acc] -> x -> (acc, y)) -> Tree x -> (acc, Tree y)
- prune :: (a -> Bool) -> Tree a -> Maybe (Tree a)
- type SIDPath = [String]
- topDownSIDPath :: (x -> (SID, Maybe ID)) -> Tree x -> Tree (SIDPath, x)
- topDownTransform :: (x -> Mat44 Float) -> Tree x -> Tree (Mat44 Float, x)
- alterSID :: (String -> a -> Maybe a) -> [(SID, a)] -> [(SID, a)]
- lookupSID :: String -> [(SID, a)] -> Maybe a
- hasDynVertex :: Typeable a => Map Semantic TypeRep -> Semantic -> a -> Bool
- dynVertex :: Typeable a => Map Semantic Dynamic -> Semantic -> Maybe a
- viewScene :: Scene -> Vec2 Int -> FrameBuffer RGBFormat DepthFormat ()
General Tree utilities
Traverse a Tree top down, much like
mapAccumL. The function recieves an accumulator from its parent and generates one that is passed down to its children.
Useful for accumulating transformations, etc.
Traverse a Tree bottom up, much like
mapAccumR. The function recieves the accumulators of all its children and generates one that is passed up to its parent.
Useful for accumulating AABBs, etc.
Remove branches of a tree where the function evaluates to
True. Useful for selecting LODs, etc.
A path where the first string in the list is the closest ID and the rest is all SIDs found in order.
Traverse a tree top down accumulating the
SIDPath for each node. The projection function enables this to be used on trees that are not
SIDPath for a node will include the node's
SID at the end, but not its
ID will however be the first
String in the
SIDPaths of the children, and the nodes
SID won't be included in this case.
Find the first element in the list that is attributed with the provided SID.
Render the scene using a simple shading technique through the first camera found, or through a defult camera if the scene doesn't contain any cameras. The scene's lights aren't
used in the rendering. The source of this function can also serve as an example of how a Collada
Scene can be processed.