Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
A point with three components: X, Y, and Z.
Since: 1.0
Synopsis
- newtype Point3D = Point3D (ManagedPtr Point3D)
- newZeroPoint3D :: MonadIO m => m Point3D
- noPoint3D :: Maybe Point3D
- point3DAlloc :: (HasCallStack, MonadIO m) => m Point3D
- point3DCross :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> m Point3D
- point3DDistance :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> m (Float, Vec3)
- point3DDot :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> m Float
- point3DEqual :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> m Bool
- point3DFree :: (HasCallStack, MonadIO m) => Point3D -> m ()
- point3DInit :: (HasCallStack, MonadIO m) => Point3D -> Float -> Float -> Float -> m Point3D
- point3DInitFromPoint :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> m Point3D
- point3DInitFromVec3 :: (HasCallStack, MonadIO m) => Point3D -> Vec3 -> m Point3D
- point3DInterpolate :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> Double -> m Point3D
- point3DLength :: (HasCallStack, MonadIO m) => Point3D -> m Float
- point3DNear :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> Float -> m Bool
- point3DNormalize :: (HasCallStack, MonadIO m) => Point3D -> m Point3D
- point3DNormalizeViewport :: (HasCallStack, MonadIO m) => Point3D -> Rect -> Float -> Float -> m Point3D
- point3DScale :: (HasCallStack, MonadIO m) => Point3D -> Float -> m Point3D
- point3DToVec3 :: (HasCallStack, MonadIO m) => Point3D -> m Vec3
- point3DZero :: (HasCallStack, MonadIO m) => m Point3D
- getPoint3DX :: MonadIO m => Point3D -> m Float
- setPoint3DX :: MonadIO m => Point3D -> Float -> m ()
- getPoint3DY :: MonadIO m => Point3D -> m Float
- setPoint3DY :: MonadIO m => Point3D -> Float -> m ()
- getPoint3DZ :: MonadIO m => Point3D -> m Float
- setPoint3DZ :: MonadIO m => Point3D -> Float -> m ()
Exported types
Memory-managed wrapper type.
Methods
Overloaded methods
alloc
:: (HasCallStack, MonadIO m) | |
=> m Point3D | Returns: the newly allocated structure.
Use |
Allocates a Point3D
structure.
Since: 1.0
cross
Computes the cross product of the two given Point3D
.
Since: 1.0
distance
:: (HasCallStack, MonadIO m) | |
=> Point3D |
|
-> Point3D |
|
-> m (Float, Vec3) | Returns: the distance between two points |
Computes the distance between the two given Point3D
.
Since: 1.4
dot
:: (HasCallStack, MonadIO m) | |
=> Point3D |
|
-> Point3D |
|
-> m Float | Returns: the value of the dot product |
Computes the dot product of the two given Point3D
.
Since: 1.0
equal
:: (HasCallStack, MonadIO m) | |
=> Point3D |
|
-> Point3D |
|
-> m Bool | Returns: |
Checks whether two given points are equal.
Since: 1.0
free
:: (HasCallStack, MonadIO m) | |
=> Point3D |
|
-> m () |
Frees the resources allocated via point3DAlloc
.
Since: 1.0
init
:: (HasCallStack, MonadIO m) | |
=> Point3D |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m Point3D | Returns: the initialized |
Initializes a Point3D
with the given coordinates.
Since: 1.0
initFromPoint
initFromVec3
interpolate
:: (HasCallStack, MonadIO m) | |
=> Point3D |
|
-> Point3D |
|
-> Double |
|
-> m Point3D |
Linearly interpolates each component of a
and b
using the
provided factor
, and places the result in res
.
Since: 1.0
length
:: (HasCallStack, MonadIO m) | |
=> Point3D |
|
-> m Float | Returns: the length of the vector represented by the point |
Computes the length of the vector represented by the
coordinates of the given Point3D
.
Since: 1.0
near
:: (HasCallStack, MonadIO m) | |
=> Point3D |
|
-> Point3D |
|
-> Float |
|
-> m Bool | Returns: |
Checks whether the two points are near each other, within
an epsilon
factor.
Since: 1.0
normalize
:: (HasCallStack, MonadIO m) | |
=> Point3D |
|
-> m Point3D |
Computes the normalization of the vector represented by the
coordinates of the given Point3D
.
Since: 1.0
normalizeViewport
point3DNormalizeViewport Source #
:: (HasCallStack, MonadIO m) | |
=> Point3D |
|
-> Rect |
|
-> Float |
|
-> Float |
|
-> m Point3D |
scale
Scales the coordinates of the given Point3D
by
the given factor
.
Since: 1.0
toVec3
:: (HasCallStack, MonadIO m) | |
=> Point3D |
|
-> m Vec3 |
zero
:: (HasCallStack, MonadIO m) | |
=> m Point3D | Returns: a zero point |
Retrieves a constant point with all three coordinates set to 0.
Since: 1.0
Properties
x
the X coordinate
getPoint3DX :: MonadIO m => Point3D -> m Float Source #
Get the value of the “x
” field.
When overloading is enabled, this is equivalent to
get
point3D #x
setPoint3DX :: MonadIO m => Point3D -> Float -> m () Source #
Set the value of the “x
” field.
When overloading is enabled, this is equivalent to
set
point3D [ #x:=
value ]
y
the Y coordinate
getPoint3DY :: MonadIO m => Point3D -> m Float Source #
Get the value of the “y
” field.
When overloading is enabled, this is equivalent to
get
point3D #y
setPoint3DY :: MonadIO m => Point3D -> Float -> m () Source #
Set the value of the “y
” field.
When overloading is enabled, this is equivalent to
set
point3D [ #y:=
value ]
z
the Z coordinate
getPoint3DZ :: MonadIO m => Point3D -> m Float Source #
Get the value of the “z
” field.
When overloading is enabled, this is equivalent to
get
point3D #z
setPoint3DZ :: MonadIO m => Point3D -> Float -> m () Source #
Set the value of the “z
” field.
When overloading is enabled, this is equivalent to
set
point3D [ #z:=
value ]