Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GI.Graphene.Structs.Sphere
Description
A sphere, represented by its center and radius.
Since: 1.2
Synopsis
- newtype Sphere = Sphere (ManagedPtr Sphere)
- newZeroSphere :: MonadIO m => m 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.
Instances
Eq Sphere Source # | |
GBoxed Sphere Source # | |
Defined in GI.Graphene.Structs.Sphere | |
ManagedPtrNewtype Sphere Source # | |
Defined in GI.Graphene.Structs.Sphere Methods toManagedPtr :: Sphere -> ManagedPtr Sphere | |
TypedObject Sphere Source # | |
Defined in GI.Graphene.Structs.Sphere | |
HasParentTypes Sphere Source # | |
Defined in GI.Graphene.Structs.Sphere | |
tag ~ 'AttrSet => Constructible Sphere tag Source # | |
IsGValue (Maybe Sphere) Source # | Convert |
Defined in GI.Graphene.Structs.Sphere Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Sphere -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Sphere) | |
type ParentTypes Sphere Source # | |
Defined in GI.Graphene.Structs.Sphere |
Methods
Click to display all available methods, including inherited ones
Methods
containsPoint, distance, equal, free, init, initFromPoints, initFromVectors, isEmpty, translate.
Getters
getBoundingBox, getCenter, getRadius.
Setters
None.
alloc
Arguments
:: (HasCallStack, MonadIO m) | |
=> m Sphere | Returns: the newly allocated |
containsPoint
Arguments
:: (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
Arguments
:: (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
Arguments
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> Sphere |
|
-> m Bool | Returns: |
Checks whether two Sphere
are equal.
Since: 1.2
free
Arguments
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> m () |
Frees the resources allocated by sphereAlloc
.
Since: 1.2
getBoundingBox
Arguments
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> m Box |
Computes the bounding box capable of containing the
given Sphere
.
Since: 1.2
getCenter
Arguments
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> m Point3D |
Retrieves the coordinates of the center of a Sphere
.
Since: 1.2
getRadius
Arguments
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> m Float |
Retrieves the radius of a Sphere
.
Since: 1.2
init
Arguments
:: (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
Arguments
:: (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 #
Arguments
:: (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
Arguments
:: (HasCallStack, MonadIO m) | |
=> Sphere |
|
-> m Bool | Returns: |
Checks whether the sphere has a zero radius.
Since: 1.2