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 2D plane that extends infinitely in a 3D volume.
The contents of the graphene_plane_t
are private, and should not be
modified directly.
Since: 1.2
Synopsis
- newtype Plane = Plane (ManagedPtr Plane)
- newZeroPlane :: MonadIO m => m Plane
- noPlane :: Maybe Plane
- planeAlloc :: (HasCallStack, MonadIO m) => m Plane
- planeDistance :: (HasCallStack, MonadIO m) => Plane -> Point3D -> m Float
- planeEqual :: (HasCallStack, MonadIO m) => Plane -> Plane -> m Bool
- planeFree :: (HasCallStack, MonadIO m) => Plane -> m ()
- planeGetConstant :: (HasCallStack, MonadIO m) => Plane -> m Float
- planeGetNormal :: (HasCallStack, MonadIO m) => Plane -> m Vec3
- planeInit :: (HasCallStack, MonadIO m) => Plane -> Maybe Vec3 -> Float -> m Plane
- planeInitFromPlane :: (HasCallStack, MonadIO m) => Plane -> Plane -> m Plane
- planeInitFromPoint :: (HasCallStack, MonadIO m) => Plane -> Vec3 -> Point3D -> m Plane
- planeInitFromPoints :: (HasCallStack, MonadIO m) => Plane -> Point3D -> Point3D -> Point3D -> m Plane
- planeInitFromVec4 :: (HasCallStack, MonadIO m) => Plane -> Vec4 -> m Plane
- planeNegate :: (HasCallStack, MonadIO m) => Plane -> m Plane
- planeNormalize :: (HasCallStack, MonadIO m) => Plane -> m Plane
Exported types
Memory-managed wrapper type.
Methods
Overloaded methods
alloc
:: (HasCallStack, MonadIO m) | |
=> m Plane | Returns: the newly allocated |
distance
:: (HasCallStack, MonadIO m) | |
=> Plane |
|
-> Point3D |
|
-> m Float | Returns: the distance of the given |
Computes the distance of point
from a Plane
.
Since: 1.2
equal
:: (HasCallStack, MonadIO m) | |
=> Plane |
|
-> Plane |
|
-> m Bool | Returns: |
Checks whether the two given Plane
are equal.
Since: 1.2
free
:: (HasCallStack, MonadIO m) | |
=> Plane |
|
-> m () |
Frees the resources allocated by planeAlloc
.
Since: 1.2
getConstant
:: (HasCallStack, MonadIO m) | |
=> Plane |
|
-> m Float | Returns: the constant value of the plane |
Retrieves the distance along the normal vector of the
given Plane
from the origin.
Since: 1.2
getNormal
:: (HasCallStack, MonadIO m) | |
=> Plane |
|
-> m Vec3 |
Retrieves the normal vector pointing towards the origin of the
given Plane
.
Since: 1.2
init
:: (HasCallStack, MonadIO m) | |
=> Plane |
|
-> Maybe Vec3 |
|
-> Float |
|
-> m Plane | Returns: the initialized plane |
Initializes the given Plane
using the given normal
vector
and constant
values.
Since: 1.2
initFromPlane
initFromPoint
:: (HasCallStack, MonadIO m) | |
=> Plane |
|
-> Vec3 |
|
-> Point3D |
|
-> m Plane | Returns: the initialized plane |
Initializes the given Plane
using the given normal vector
and an arbitrary co-planar point.
Since: 1.2
initFromPoints
:: (HasCallStack, MonadIO m) | |
=> Plane |
|
-> Point3D |
|
-> Point3D |
|
-> Point3D |
|
-> m Plane | Returns: the initialized plane |
Initializes the given Plane
using the 3 provided co-planar
points.
The winding order is counter-clockwise, and determines which direction the normal vector will point.
Since: 1.2
initFromVec4
negate
:: (HasCallStack, MonadIO m) | |
=> Plane |
|
-> m Plane |
Negates the normal vector and constant of a Plane
, effectively
mirroring the plane across the origin.
Since: 1.2