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 3D box, described as the volume between a minimum and a maximum vertices.
Since: 1.2
Synopsis
- newtype Box = Box (ManagedPtr Box)
- newZeroBox :: MonadIO m => m Box
- noBox :: Maybe Box
- boxAlloc :: (HasCallStack, MonadIO m) => m Box
- boxContainsBox :: (HasCallStack, MonadIO m) => Box -> Box -> m Bool
- boxContainsPoint :: (HasCallStack, MonadIO m) => Box -> Point3D -> m Bool
- boxEmpty :: (HasCallStack, MonadIO m) => m Box
- boxEqual :: (HasCallStack, MonadIO m) => Box -> Box -> m Bool
- boxExpand :: (HasCallStack, MonadIO m) => Box -> Point3D -> m Box
- boxExpandScalar :: (HasCallStack, MonadIO m) => Box -> Float -> m Box
- boxExpandVec3 :: (HasCallStack, MonadIO m) => Box -> Vec3 -> m Box
- boxFree :: (HasCallStack, MonadIO m) => Box -> m ()
- boxGetBoundingSphere :: (HasCallStack, MonadIO m) => Box -> m Sphere
- boxGetCenter :: (HasCallStack, MonadIO m) => Box -> m Point3D
- boxGetDepth :: (HasCallStack, MonadIO m) => Box -> m Float
- boxGetHeight :: (HasCallStack, MonadIO m) => Box -> m Float
- boxGetMax :: (HasCallStack, MonadIO m) => Box -> m Point3D
- boxGetMin :: (HasCallStack, MonadIO m) => Box -> m Point3D
- boxGetSize :: (HasCallStack, MonadIO m) => Box -> m Vec3
- boxGetWidth :: (HasCallStack, MonadIO m) => Box -> m Float
- boxInfinite :: (HasCallStack, MonadIO m) => m Box
- boxInit :: (HasCallStack, MonadIO m) => Box -> Maybe Point3D -> Maybe Point3D -> m Box
- boxInitFromBox :: (HasCallStack, MonadIO m) => Box -> Box -> m Box
- boxInitFromPoints :: (HasCallStack, MonadIO m) => Box -> [Point3D] -> m Box
- boxInitFromVec3 :: (HasCallStack, MonadIO m) => Box -> Maybe Vec3 -> Maybe Vec3 -> m Box
- boxInitFromVectors :: (HasCallStack, MonadIO m) => Box -> [Vec3] -> m Box
- boxIntersection :: (HasCallStack, MonadIO m) => Box -> Box -> m (Bool, Box)
- boxMinusOne :: (HasCallStack, MonadIO m) => m Box
- boxOne :: (HasCallStack, MonadIO m) => m Box
- boxOneMinusOne :: (HasCallStack, MonadIO m) => m Box
- boxUnion :: (HasCallStack, MonadIO m) => Box -> Box -> m Box
- boxZero :: (HasCallStack, MonadIO m) => m Box
Exported types
Memory-managed wrapper type.
Box (ManagedPtr Box) |
Methods
Overloaded methods
alloc
:: (HasCallStack, MonadIO m) | |
=> m Box | Returns: the newly allocated |
containsBox
containsPoint
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> Point3D |
|
-> m Bool | Returns: |
Checks whether box
contains the given point
.
Since: 1.2
empty
:: (HasCallStack, MonadIO m) | |
=> m Box | Returns: a |
A degenerate Box
that can only be expanded.
The returned value is owned by Graphene and should not be modified or freed.
Since: 1.2
equal
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> Box |
|
-> m Bool | Returns: |
Checks whether the two given boxes are equal.
Since: 1.2
expand
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> Point3D |
|
-> m Box |
Expands the dimensions of box
to include the coordinates at point
.
Since: 1.2
expandScalar
expandVec3
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> Vec3 |
|
-> m Box |
Expands the dimensions of box
to include the coordinates of the
given vector.
Since: 1.2
free
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> m () |
Frees the resources allocated by boxAlloc
.
Since: 1.2
getBoundingSphere
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> m Sphere |
getCenter
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> m Point3D |
Retrieves the coordinates of the center of a Box
.
Since: 1.2
getDepth
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> m Float | Returns: the depth of the box |
Retrieves the size of the box
on the Z axis.
Since: 1.2
getHeight
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> m Float | Returns: the height of the box |
Retrieves the size of the box
on the Y axis.
Since: 1.2
getMax
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> m Point3D |
Retrieves the coordinates of the maximum point of the given
Box
.
Since: 1.2
getMin
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> m Point3D |
Retrieves the coordinates of the minimum point of the given
Box
.
Since: 1.2
getSize
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> m Vec3 |
Retrieves the size of the box on all three axes, and stores
it into the given size
vector.
Since: 1.2
getWidth
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> m Float | Returns: the width of the box |
Retrieves the size of the box
on the X axis.
Since: 1.2
infinite
:: (HasCallStack, MonadIO m) | |
=> m Box | Returns: a |
A degenerate Box
that cannot be expanded.
The returned value is owned by Graphene and should not be modified or freed.
Since: 1.2
init
:: (HasCallStack, MonadIO m) | |
=> Box |
|
-> Maybe Point3D |
|
-> Maybe Point3D |
|
-> m Box | Returns: the initialized |
Initializes the given Box
with two vertices.
Since: 1.2
initFromBox
initFromPoints
initFromVec3
initFromVectors
intersection
minusOne
:: (HasCallStack, MonadIO m) | |
=> m Box | Returns: a |
A Box
with the minimum vertex set at (-1, -1, -1) and the
maximum vertex set at (0, 0, 0).
The returned value is owned by Graphene and should not be modified or freed.
Since: 1.2
one
:: (HasCallStack, MonadIO m) | |
=> m Box | Returns: a |
A Box
with the minimum vertex set at (0, 0, 0) and the
maximum vertex set at (1, 1, 1).
The returned value is owned by Graphene and should not be modified or freed.
Since: 1.2
oneMinusOne
:: (HasCallStack, MonadIO m) | |
=> m Box | Returns: a |
A Box
with the minimum vertex set at (-1, -1, -1) and the
maximum vertex set at (1, 1, 1).
The returned value is owned by Graphene and should not be modified or freed.
Since: 1.2
union
Unions the two given Box
.
Since: 1.2