Safe Haskell | None |
---|
Typeclasses for basic 3D operations
- class Position3D t where
- position3D :: t -> IO Vec3
- positionTo3D :: t -> Vec3 -> IO ()
- class Scale3D t where
- class Direction3D t where
- direction3D :: t -> IO Vec3
- directionTo3D :: t -> Vec3 -> IO ()
- class Orientation3D t where
- orientation3D :: t -> IO UnitQuaternion
- orientationTo3D :: t -> UnitQuaternion -> IO ()
- translate3D :: Position3D t => t -> Vec3 -> IO ()
- yaw3D :: Orientation3D t => t -> Angle -> IO ()
- pitch3D :: Orientation3D t => t -> Angle -> IO ()
- roll3D :: Orientation3D t => t -> Angle -> IO ()
Types
class Position3D t whereSource
a type with a Position3D instance can be positioned
position3D :: t -> IO Vec3Source
get position function
positionTo3D :: t -> Vec3 -> IO ()Source
set position function
a type with a Scale3D instance can be scaled
class Direction3D t whereSource
a type with a Direction3D instance can be oriented towards a point (Camera for example)
direction3D :: t -> IO Vec3Source
get direction function
directionTo3D :: t -> Vec3 -> IO ()Source
set direction function
class Orientation3D t whereSource
a type with an Orientation3D instance can be oriented in space
orientation3D :: t -> IO UnitQuaternionSource
get orientation function
orientationTo3D :: t -> UnitQuaternion -> IO ()Source
set orientation function
Functions
translate3D :: Position3D t => t -> Vec3 -> IO ()Source
move position function
yaw3D :: Orientation3D t => t -> Angle -> IO ()Source
rotate object on own axis (yaw) by angle
pitch3D :: Orientation3D t => t -> Angle -> IO ()Source
rotate object on own axis (pitch) by angle
roll3D :: Orientation3D t => t -> Angle -> IO ()Source
rotate object on own axis (roll) by angle