-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Data exchange between graphic applications -- -- Collada is the standard graphics format for data exchange between 3d -- tools. As well as the file format also its representation as an -- algebraic data type could be used to make libraries more composable. -- Please propose changes. @package collada-types @version 0.3 module Graphics.Formats.Collada.Vector2D3D -- | An angle is a number between -pi and pi. type Angle = Float -- | 2D vector: a pair of coordinates. data V2 V :: {-# UNPACK #-} !Float -> {-# UNPACK #-} !Float -> V2 data V3 V3 :: {-# UNPACK #-} !Float -> {-# UNPACK #-} !Float -> {-# UNPACK #-} !Float -> V3 data V4 V4 :: {-# UNPACK #-} !Float -> {-# UNPACK #-} !Float -> {-# UNPACK #-} !Float -> {-# UNPACK #-} !Float -> V4 -- | 2D affine transformation. No shearing allowed, only translation, -- rotation, and scaling. Transformations can be chained with -- mappend, and mempty is the identity transformation. data T2 -- | Unit vector with the given direction. unit :: Angle -> V2 -- | Multiplication with a scalar. (*.) :: V2 -> Float -> V2 -- | Multiplication with a scalar. -- -- Division by a scalar. -- -- Dot product. dot :: V2 -> V2 -> Float -- | Dot product. dot3 :: V3 -> V3 -> Float -- | Perp-dot product (2D cross product). cross :: V2 -> V2 -> Float -- | 3D cross product. cross3 :: V3 -> V3 -> V3 -- | Vector rotated 90 degrees leftwards. perpL :: V2 -> V2 -- | Vector rotated 90 degrees rightwards. perpR :: V2 -> V2 mul :: V3 -> Float -> V3 divide :: V3 -> Float -> V3 -- | Relative direction of two vectors: turn v1 v2 equals -- GT if v2 takes a left turn with respect to -- v1, LT if it is a right turn, and EQ if -- they are parallel. turn :: V2 -> V2 -> Ordering -- |
-- turnL v1 v2 == (turn v1 v2 == GT) --turnL :: V2 -> V2 -> Bool -- |
-- turnNL v1 v2 == (turn v1 v2 /= GT) --turnNL :: V2 -> V2 -> Bool -- |
-- turnR v1 v2 == (turn v1 v2 == LT) --turnR :: V2 -> V2 -> Bool -- |
-- turnNR v1 v2 == (turn v1 v2 /= LT) --turnNR :: V2 -> V2 -> Bool -- |
-- parv v1 v2 == (turn v1 v2 == EQ) --parv :: V2 -> V2 -> Bool -- | Vector length squared. square :: V2 -> Float -- | Vector length. mag :: V2 -> Float -- | Vector normalisation. norm :: V2 -> V2 -- | 3d Vector length. -- -- Set Vector length. -- -- The angle of a vector with respect to the X axis. dir :: V2 -> Angle v_len :: V3 -> Float set_len :: V3 -> Float -> V3 -- | Inverse transformation inverse :: T2 -> T2 -- | Transformation applied to a vector. (<>) :: T2 -> V2 -> V2 -- | Transformation representing a translation. translate :: V2 -> T2 -- | Transformation representing a rotation. rotate :: Angle -> T2 -- | Transformation representing a scaling. scale :: Float -> T2 -- | The translation factor of a transformation. translationOf :: T2 -> V2 -- | The rotation factor of a transformation. rotationOf :: T2 -> Angle -- | The scaling factor of a transformation. scaleOf :: T2 -> Float -- | Replacing the translation factor of a transformation. withTranslation :: T2 -> V2 -> T2 -- | Replacing the rotation factor of a transformation. withRotation :: T2 -> Angle -> T2 -- | Replacing the scaling factor of a transformation. withScale :: T2 -> Float -> T2 instance Show V2 instance Eq V2 instance Ord V2 instance Show V3 instance Eq V3 instance Ord V3 instance Show V4 instance Eq V4 instance Ord V4 instance Show T2 instance Monoid T2 instance Num V3 instance Num V2 module Graphics.Formats.Collada.ColladaTypes type Scene = Tree SceneNode data SceneNode SceneNode :: ID -> NodeType -> [String] -> [(SID, Transform)] -> [Camera] -> [Controller] -> [Geometry] -> [Light] -> SceneNode nodeId :: SceneNode -> ID nodeType :: SceneNode -> NodeType nodeLayers :: SceneNode -> [String] nodeTransformations :: SceneNode -> [(SID, Transform)] nodeCameras :: SceneNode -> [Camera] nodeController :: SceneNode -> [Controller] nodeGeometries :: SceneNode -> [Geometry] nodeLights :: SceneNode -> [Light] EmptyRoot :: SceneNode data NodeType JOINT :: NodeType NODE :: NodeType NOTYPE :: NodeType data Transform LookAt :: V3 -> V3 -> V3 -> Transform lookAtEye :: Transform -> V3 lookAtInterest :: Transform -> V3 lookAtUp :: Transform -> V3 Matrix :: Mat44 -> Transform Rotate :: V3 -> Float -> V3 -> Float -> V3 -> Float -> Transform Scale :: V3 -> Transform Skew :: Float -> V3 -> V3 -> Transform skewAngle :: Transform -> Float skewRotation :: Transform -> V3 skewTranslation :: Transform -> V3 Translate :: V3 -> Transform data Camera Perspective :: ID -> ViewSize -> Z -> Camera perspectiveID :: Camera -> ID perspectiveFov :: Camera -> ViewSize perspectiveZ :: Camera -> Z Orthographic :: ID -> ViewSize -> Z -> Camera orthographicID :: Camera -> ID orthographicViewSize :: Camera -> ViewSize orthographicZ :: Camera -> Z data ViewSize ViewSizeX :: Float -> ViewSize ViewSizeY :: Float -> ViewSize ViewSizeXY :: (Float, Float) -> ViewSize data Z Z :: Float -> Float -> Z zNear :: Z -> Float zFar :: Z -> Float data Light Ambient :: ID -> Color -> Light ambientID :: Light -> ID ambientColor :: Light -> Color Directional :: ID -> Color -> Light directionalID :: Light -> ID directionalColor :: Light -> Color Point :: ID -> Color -> Attenuation -> Light pointID :: Light -> ID pointColor :: Light -> Color pointAttenuation :: Light -> Attenuation Spot :: ID -> Color -> Attenuation -> Float -> Float -> Light spotID :: Light -> ID spotColor :: Light -> Color spotAttenuation :: Light -> Attenuation spotFallOffAngle :: Light -> Float spotFallOffExponent :: Light -> Float data Attenuation Attenuation :: Float -> Float -> Float -> Attenuation attenuationConstant :: Attenuation -> Float attenuationLinear :: Attenuation -> Float attenuationQuadratic :: Attenuation -> Float data Controller Controller :: ID -> [Skin] -> [Morph] -> Controller contrId :: Controller -> ID skin :: Controller -> [Skin] morph :: Controller -> [Morph] data Geometry Geometry :: ID -> [Mesh] -> Vertices -> Geometry meshID :: Geometry -> ID mesh :: Geometry -> [Mesh] vertices :: Geometry -> Vertices data Mesh -- | Lines LP :: LinePrimitive -> Mesh -- | LineStrips LS :: LinePrimitive -> Mesh -- | Polygon: Contains polygon primitives which may contain holes. P :: Polygon -> Mesh -- | PolyList: Contains polygon primitives that cannot contain holes. PL :: LinePrimitive -> Mesh -- | Triangles Tr :: LinePrimitive -> Mesh -- | TriFans Trf :: LinePrimitive -> Mesh -- | TriStrips Trs :: LinePrimitive -> Mesh -- | Splines S :: LinePrimitive -> Mesh data Vertices Vertices :: ID -> Vector V3 -> Vector V3 -> Vertices name :: Vertices -> ID verts :: Vertices -> Vector V3 normals :: Vertices -> Vector V3 data LinePrimitive LinePrimitive :: Vector (Vector Int) -> Vector (Vector Int) -> Vector (Vector Int) -> [Material] -> LinePrimitive lineP :: LinePrimitive -> Vector (Vector Int) lineN :: LinePrimitive -> Vector (Vector Int) lineT :: LinePrimitive -> Vector (Vector Int) ms :: LinePrimitive -> [Material] data Polygon Polygon :: Vector (Vector Int) -> Vector (Vector Int) -> (Vector Int, Vector Int) -> [Material] -> Polygon poylgonP :: Polygon -> Vector (Vector Int) poylgonN :: Polygon -> Vector (Vector Int) polygonPh :: Polygon -> (Vector Int, Vector Int) polygonMs :: Polygon -> [Material] data AnimChannel AnimChannel :: (ID, [Float], Accessor) -> (ID, [Float], Accessor) -> [Interpolation] -> [(TargetID, AccessorName)] -> AnimChannel input :: AnimChannel -> (ID, [Float], Accessor) output :: AnimChannel -> (ID, [Float], Accessor) interp :: AnimChannel -> [Interpolation] targets :: AnimChannel -> [(TargetID, AccessorName)] EmptyAnim :: AnimChannel type ID = String type SID = String data Semantic data Profile BRIDGE :: Asset -> Extra -> Profile CG :: Asset -> Code -> Include -> NewParam -> TechniqueCG -> Extra -> Profile COMMON :: Asset -> NewParam -> TechniqueCommon -> String -> Profile GLES :: Asset -> NewParam -> TechniqueCG -> Extra -> Profile GLES2 :: Asset -> Code -> Include -> NewParam -> TechniqueCG -> Extra -> Profile GLSL :: Asset -> Code -> Include -> NewParam -> TechniqueCG -> Extra -> Profile data NewParam Annotat :: NewParam Semantic :: NewParam Modifier :: NewParam NoParam :: NewParam data TechniqueCommon Constant :: TechniqueCommon LambertCol :: [Fx_common_color_type] -> TechniqueCommon LambertTex :: [Fx_common_texture_type] -> [[Float]] -> TechniqueCommon PhongCol :: [Fx_common_color_type] -> TechniqueCommon PhongTex :: [Fx_common_texture_type] -> [[Float]] -> TechniqueCommon Blinn :: TechniqueCommon type Material = (SID, Effect) type Effect = Profile data C Color :: V4 -> C data Color RGB :: Float -> Float -> Float -> Color type Animation = Tree (SID, AnimChannel) data Fx_common_color_type CEmission :: C -> Fx_common_color_type CAmbient :: C -> Fx_common_color_type CDiffuse :: C -> Fx_common_color_type CSpecular :: C -> Fx_common_color_type CShininess :: Float -> Fx_common_color_type CReflective :: C -> Fx_common_color_type CReflectivity :: Float -> Fx_common_color_type CTransparent :: C -> Fx_common_color_type CTransparency :: Float -> Fx_common_color_type CIndex_of_refraction :: Float -> Fx_common_color_type data Fx_common_texture_type TEmission :: Texture -> Fx_common_texture_type TAmbient :: Texture -> Fx_common_texture_type TDiffuse :: Texture -> Fx_common_texture_type TSpecular :: Texture -> Fx_common_texture_type TShininess :: Float -> Fx_common_texture_type TReflective :: Texture -> Fx_common_texture_type TReflectivity :: Float -> Fx_common_texture_type TTransparent :: Texture -> Fx_common_texture_type TTransparency :: Float -> Fx_common_texture_type TIndex_of_refraction :: Float -> Fx_common_texture_type data Texture Texture :: ID -> String -> Maybe TextureObject -> Texture imageSID :: Texture -> ID path :: Texture -> String texObj :: Texture -> Maybe TextureObject data Interpolation Step :: Interpolation Linear :: Interpolation Bezier :: [Float] -> [Float] -> Interpolation instance Show NodeType instance Eq NodeType instance Show Transform instance Eq Transform instance Show ViewSize instance Eq ViewSize instance Show Z instance Eq Z instance Show Attenuation instance Eq Attenuation instance Show MorphMethod instance Eq MorphMethod instance Show Joint instance Eq Joint instance Show Skin instance Eq Skin instance Show Semantic instance Eq Semantic instance Show Input instance Eq Input instance Show Morph instance Eq Morph instance Show Interpolation instance Eq Interpolation instance Show NewParam instance Eq NewParam instance Show TechniqueCG instance Eq TechniqueCG instance Show Extra instance Eq Extra instance Show Technique instance Eq Technique instance Show C instance Eq C instance Show Fx_common_color_type instance Eq Fx_common_color_type instance Show Texture instance Eq Texture instance Show Fx_common_texture_type instance Eq Fx_common_texture_type instance Show TechniqueCommon instance Eq TechniqueCommon instance Show Profile instance Eq Profile instance Show AnimChannel instance Eq AnimChannel instance Show Vertices instance Eq Vertices instance Show Controller instance Eq Controller instance Show Camera instance Eq Camera instance Show Polygon instance Eq Polygon instance Show LinePrimitive instance Eq LinePrimitive instance Show Mesh instance Eq Mesh instance Show Geometry instance Eq Color instance Show Color instance Show Light instance Eq Light instance Show SceneNode instance Eq SceneNode instance Eq Geometry module Graphics.Formats.Collada.GenerateObjects -- | An animated cube animatedCube :: (Scene, [Animation]) -- | Example scene with a cube aScene :: Scene lightedGeometry :: [Geometry] -> Scene lightedSceneNode :: SceneNode -> Scene lightedScene :: Scene -> Scene -- | Every scene needs a camera and light aCube :: SceneNode obj :: String -> [Geometry] -> V3 -> SceneNode -- | Example animation of the cube animation :: [Animation] -- | A blue/textured cube cube :: Geometry polys :: Vector V3 -> Vector V3 -> Vector (Vector Int) -> Vector (Vector Int) -> [Geometry] lines :: Vector V3 -> Vector V3 -> Vector (Vector Int) -> Vector (Vector Int) -> [Geometry] trifans :: Vector V3 -> Vector V3 -> Vector (Vector Int) -> Vector (Vector Int) -> [Geometry] tristrips :: Vector V3 -> Vector V3 -> Vector (Vector Int) -> Vector (Vector Int) -> [Geometry] ge :: Geometry -> SceneNode scene2 :: Scene -- | Animation of several cubes animation2 :: [Animation] emptyAnimation :: [[Animation]] emptyAnim :: [Animation] -- | generate an animation that points to the cubes new_channels :: AnimChannel -> [SceneNode] -> AnimChannel -- | a helper function for xyz_grid tran :: SceneNode -> V3 -> String -> SceneNode test_objs :: [SceneNode] -- | Generate a 3 dimensional grid where an object (stored in a SceneNode) -- is repeated in along the grid xyz_grid :: Int -> Int -> Int -> Float -> SceneNode -> [SceneNode] en :: [(Float, Float, Float)] rename :: SceneNode -> String -> SceneNode streamScene :: [SceneNode] -> Scene streamAnimation :: [(Float, Float, Float)] -> [SceneNode] -> [Animation] module Graphics.Formats.Collada.Transformations translate :: V3 -> Geometry -> Geometry -- | extrude a 2d polygon to 3d, the same points are added again with -- extrusion direction v extrude :: V3 -> Geometry -> Geometry extr_outline :: Vector Int -> Vector (Vector Int) -- | return a list containing lists of every element with its neighbour -- i.e. [e1,e2,e3] -> [ [e1,e2], [e2,e3], [e3, e1] ] cycleNeighbours :: Vector a -> Vector (Vector a) cycleN :: a -> Vector a -> Vector (Vector a) atop :: Geometry -> Geometry -> Geometry changeDiffuseColor :: String -> V4 -> Geometry -> Geometry changeAmbientColor :: String -> V4 -> Geometry -> Geometry