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 sphere, represented by its center and radius.
Since: 1.2
Synopsis
- newtype Sphere = Sphere (ManagedPtr Sphere)
- newZeroSphere :: MonadIO m => m Sphere
- noSphere :: Maybe Sphere
- sphereAlloc :: (HasCallStack, MonadIO m) => m Sphere
- sphereContainsPoint :: (HasCallStack, MonadIO m) => Sphere -> Point3D -> m Bool
- sphereDistance :: (HasCallStack, MonadIO m) => Sphere -> Point3D -> m Float
- sphereEqual :: (HasCallStack, MonadIO m) => Sphere -> Sphere -> m Bool
- sphereFree :: (HasCallStack, MonadIO m) => Sphere -> m ()
- sphereGetBoundingBox :: (HasCallStack, MonadIO m) => Sphere -> m Box
- sphereGetCenter :: (HasCallStack, MonadIO m) => Sphere -> m Point3D
- sphereGetRadius :: (HasCallStack, MonadIO m) => Sphere -> m Float
- sphereInit :: (HasCallStack, MonadIO m) => Sphere -> Maybe Point3D -> Float -> m Sphere
- sphereInitFromPoints :: (HasCallStack, MonadIO m) => Sphere -> [Point3D] -> Maybe Point3D -> m Sphere
- sphereInitFromVectors :: (HasCallStack, MonadIO m) => Sphere -> [Vec3] -> Maybe Point3D -> m Sphere
- sphereIsEmpty :: (HasCallStack, MonadIO m) => Sphere -> m Bool
- sphereTranslate :: (HasCallStack, MonadIO m) => Sphere -> Point3D -> m Sphere
Exported types
Memory-managed wrapper type.
Methods
Overloaded methods
alloc
:: (HasCallStack, MonadIO m) | |
=> m Sphere | Returns: the newly allocated |
containsPoint
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> Point3D |
|
-> m Bool | Returns: |
Checks whether the given point
is contained in the volume
of a Sphere
.
Since: 1.2
distance
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> Point3D |
|
-> m Float | Returns: the distance of the point |
Computes the distance of the given point
from the surface of
a Sphere
.
Since: 1.2
equal
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> Sphere |
|
-> m Bool | Returns: |
Checks whether two Sphere
are equal.
Since: 1.2
free
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> m () |
Frees the resources allocated by sphereAlloc
.
Since: 1.2
getBoundingBox
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> m Box |
Computes the bounding box capable of containing the
given Sphere
.
Since: 1.2
getCenter
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> m Point3D |
Retrieves the coordinates of the center of a Sphere
.
Since: 1.2
getRadius
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> m Float |
Retrieves the radius of a Sphere
.
Since: 1.2
init
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> Maybe Point3D |
|
-> Float |
|
-> m Sphere | Returns: the initialized |
Initializes the given Sphere
with the given center
and radius
.
Since: 1.2
initFromPoints
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> [Point3D] |
|
-> Maybe Point3D |
|
-> m Sphere | Returns: the initialized |
Initializes the given Sphere
using the given array
of 3D coordinates so that the sphere includes them.
The center of the sphere can either be specified, or will be center
of the 3D volume that encompasses all points
.
Since: 1.2
initFromVectors
sphereInitFromVectors Source #
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> [Vec3] |
|
-> Maybe Point3D |
|
-> m Sphere | Returns: the initialized |
Initializes the given Sphere
using the given array
of 3D coordinates so that the sphere includes them.
The center of the sphere can either be specified, or will be center
of the 3D volume that encompasses all vectors
.
Since: 1.2
isEmpty
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> m Bool | Returns: |
Checks whether the sphere has a zero radius.
Since: 1.2