hgeometry-0.8.0.0: Geometric Algorithms, Data structures, and Data types.

Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Graphics.Camera

Description

Description : Data type to represent a camera and some functions for working with it.

Synopsis

Documentation

data Camera r Source #

defines a basic camera

Constructors

Camera !(Point 3 r) !(Vector 3 r) !(Vector 3 r) !r !r !r !(Vector 2 r) 
Instances
Eq r => Eq (Camera r) Source # 
Instance details

Defined in Graphics.Camera

Methods

(==) :: Camera r -> Camera r -> Bool #

(/=) :: Camera r -> Camera r -> Bool #

Ord r => Ord (Camera r) Source # 
Instance details

Defined in Graphics.Camera

Methods

compare :: Camera r -> Camera r -> Ordering #

(<) :: Camera r -> Camera r -> Bool #

(<=) :: Camera r -> Camera r -> Bool #

(>) :: Camera r -> Camera r -> Bool #

(>=) :: Camera r -> Camera r -> Bool #

max :: Camera r -> Camera r -> Camera r #

min :: Camera r -> Camera r -> Camera r #

Show r => Show (Camera r) Source # 
Instance details

Defined in Graphics.Camera

Methods

showsPrec :: Int -> Camera r -> ShowS #

show :: Camera r -> String #

showList :: [Camera r] -> ShowS #

cameraPosition :: forall r. Lens' (Camera r) (Point 3 r) Source #

rawCameraNormal :: forall r. Lens' (Camera r) (Vector 3 r) Source #

rawViewUp :: forall r. Lens' (Camera r) (Vector 3 r) Source #

viewPlaneDepth :: forall r. Lens' (Camera r) r Source #

nearDist :: forall r. Lens' (Camera r) r Source #

farDist :: forall r. Lens' (Camera r) r Source #

screenDimensions :: forall r. Lens' (Camera r) (Vector 2 r) Source #

cameraNormal :: Floating r => Lens' (Camera r) (Vector 3 r) Source #

Lens to get and set the Camera normal, makes sure that the vector remains normalized.

viewUp :: Floating r => Lens' (Camera r) (Vector 3 r) Source #

Lens to get and set the viewUp vector. Makes sure the vector remains normalized.

cameraTransform :: Fractional r => Camera r -> Transformation 3 r Source #

Full transformation that renders the figure

worldToView :: Fractional r => Camera r -> Transformation 3 r Source #

Translates world coordinates into view coordinates

toViewPort :: Fractional r => Camera r -> Transformation 3 r Source #

Transformation into viewport coordinates

perspectiveProjection :: Fractional r => Camera r -> Transformation 3 r Source #

constructs a perspective projection

rotateCoordSystem :: Num r => Camera r -> Transformation 3 r Source #

Rotates coordinate system around the camera, such that we look in the negative z direction

flipAxes :: Num r => Transformation 3 r Source #

Flips the y and z axis.