| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Waterfall.Transforms
Contents
Synopsis
- class Transformable a
- matTransform :: Transformable a => M34 Double -> a -> a
- scale :: Transformable a => V3 Double -> a -> a
- uScale :: Transformable a => Double -> a -> a
- rotate :: Transformable a => V3 Double -> Double -> a -> a
- translate :: Transformable a => V3 Double -> a -> a
- mirror :: Transformable a => V3 Double -> a -> a
- _translated :: Transformable t => V3 Double -> Iso' t t
- _scaled :: Transformable t => V3 Double -> Maybe (Iso' t t)
- _uScaled :: Transformable t => Double -> Maybe (Iso' t t)
- _rotated :: Transformable t => V3 Double -> Double -> Iso' t t
- _mirrored :: Transformable t => V3 Double -> Iso' t t
Transformations
class Transformable a Source #
Typeclass for objects that can be manipulated in 3D space
Instances
| Transformable Path Source # | |
Defined in Waterfall.Transforms | |
| Transformable Solid Source # | |
Defined in Waterfall.Transforms | |
| Transformable (V3 Double) Source # | |
Defined in Waterfall.Transforms | |
matTransform :: Transformable a => M34 Double -> a -> a Source #
Directly transform with a transformation matrix
scale :: Transformable a => V3 Double -> a -> a Source #
Scale by different amounts along the x, y and z axes
uScale :: Transformable a => Double -> a -> a Source #
Scale uniformly along all axes
rotate :: Transformable a => V3 Double -> Double -> a -> a Source #
Rotate by Axis and Angle (in radians)
mirror :: Transformable a => V3 Double -> a -> a Source #
Mirror in the plane, which passes through the origin, perpendicular to the specified vector
Optics
_translated :: Transformable t => V3 Double -> Iso' t t Source #
Every translation is an isomorphism
_scaled :: Transformable t => V3 Double -> Maybe (Iso' t t) Source #
A scale by v as an isomorphism
Returns Nothing when any component of v is (near) zero,
as a scale that collapses an axis has no inverse.
_uScaled :: Transformable t => Double -> Maybe (Iso' t t) Source #
A scale by s as an isomorphism
Returns Nothing when s is (near) zero,
as a scale that collapses everything to the origin has no inverse.