Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Position = V3 Float
- type Rotation = M33 Float
- type DCPosition = V2 Float
- type SCPosition = V2 Int
- type Normal = V3 Float
- data Vertex = Vertex Position
- v_position :: Lens' Vertex Position
- data DCVertex = DCVertex DCPosition Float
- dcv_position :: Lens' DCVertex DCPosition
- zBuffer :: Lens' DCVertex Float
- fromVertex :: Vertex -> DCVertex
- data SCVertex = SCVertex SCPosition Float
- scv_position :: Lens' SCVertex SCPosition
- depth :: Lens' SCVertex Float
- data PrimitiveBase vtype
- type Primitive = PrimitiveBase Vertex
- calcNormal :: Primitive -> Normal
- data DCPrimitive = DCPrimitive (PrimitiveBase DCVertex) Normal
- unPrimitive :: Lens' DCPrimitive (PrimitiveBase DCVertex)
- normal :: Lens' DCPrimitive Normal
- vertices :: Traversal' Primitive Vertex
- toDCPrimitive :: Applicative f => (Vertex -> f DCVertex) -> Primitive -> f DCPrimitive
Basic type aliases
type DCPosition = V2 Float Source #
Position in Device Coordinate
Device coordnate is a Coordinate that put (0,0) on the center, and Y axis is positive above the center. X axis is positive on the right. The value have range of -1~1 and floating number(As shown in the Type definition)
type SCPosition = V2 Int Source #
Position in Screen Coordinate
Screen Coordinate is a Coordinate that
is associated with actuall "pixel" of
the screen.
In this case, as we use Canvas
for screen, (0, 0) is set at the Top-Left
corner.
Vertices
Vertex
that is mapped to Device Coordinate
A vertex on Screen Coordinate.
Primitives
data PrimitiveBase vtype Source #
Define Primitive shapes. This would
Instances
Eq vtype => Eq (PrimitiveBase vtype) Source # | |
Defined in Brick3D.Type (==) :: PrimitiveBase vtype -> PrimitiveBase vtype -> Bool # (/=) :: PrimitiveBase vtype -> PrimitiveBase vtype -> Bool # | |
Ord vtype => Ord (PrimitiveBase vtype) Source # | |
Defined in Brick3D.Type compare :: PrimitiveBase vtype -> PrimitiveBase vtype -> Ordering # (<) :: PrimitiveBase vtype -> PrimitiveBase vtype -> Bool # (<=) :: PrimitiveBase vtype -> PrimitiveBase vtype -> Bool # (>) :: PrimitiveBase vtype -> PrimitiveBase vtype -> Bool # (>=) :: PrimitiveBase vtype -> PrimitiveBase vtype -> Bool # max :: PrimitiveBase vtype -> PrimitiveBase vtype -> PrimitiveBase vtype # min :: PrimitiveBase vtype -> PrimitiveBase vtype -> PrimitiveBase vtype # | |
Show vtype => Show (PrimitiveBase vtype) Source # | |
Defined in Brick3D.Type showsPrec :: Int -> PrimitiveBase vtype -> ShowS # show :: PrimitiveBase vtype -> String # showList :: [PrimitiveBase vtype] -> ShowS # |
type Primitive = PrimitiveBase Vertex Source #
Primitive shape that in 3D world
data DCPrimitive Source #
Primitive
that is shaded on Device Coordinate
Utility functions
toDCPrimitive :: Applicative f => (Vertex -> f DCVertex) -> Primitive -> f DCPrimitive Source #
THIS ISN'T Traversal
Convert Primitive
to DCPrimitive