Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
GI.Graphene.Structs.Plane
Description
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
- 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
- planeTransform :: (HasCallStack, MonadIO m) => Plane -> Matrix -> Maybe Matrix -> m Plane
Exported types
Memory-managed wrapper type.
Constructors
Plane (ManagedPtr Plane) |
Instances
Eq Plane Source # | |
GBoxed Plane Source # | |
Defined in GI.Graphene.Structs.Plane | |
ManagedPtrNewtype Plane Source # | |
Defined in GI.Graphene.Structs.Plane Methods toManagedPtr :: Plane -> ManagedPtr Plane # | |
TypedObject Plane Source # | |
Defined in GI.Graphene.Structs.Plane | |
HasParentTypes Plane Source # | |
Defined in GI.Graphene.Structs.Plane | |
tag ~ 'AttrSet => Constructible Plane tag Source # | |
Defined in GI.Graphene.Structs.Plane | |
IsGValue (Maybe Plane) Source # | Convert |
Defined in GI.Graphene.Structs.Plane Methods gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe Plane -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe Plane) # | |
type ParentTypes Plane Source # | |
Defined in GI.Graphene.Structs.Plane type ParentTypes Plane = '[] :: [Type] |
newZeroPlane :: MonadIO m => m Plane Source #
Construct a Plane
struct initialized to zero.
Methods
Click to display all available methods, including inherited ones
Methods
distance, equal, free, init, initFromPlane, initFromPoint, initFromPoints, initFromVec4, negate, normalize, transform.
Getters
Setters
None.
alloc
distance
Arguments
:: (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
Arguments
:: (HasCallStack, MonadIO m) | |
=> Plane |
|
-> Plane |
|
-> m Bool | Returns: |
Checks whether the two given Plane
are equal.
Since: 1.2
free
Frees the resources allocated by planeAlloc
.
Since: 1.2
getConstant
Arguments
:: (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
Retrieves the normal vector pointing towards the origin of the
given Plane
.
Since: 1.2
init
Arguments
:: (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
Arguments
:: (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
Arguments
:: (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
Negates the normal vector and constant of a Plane
, effectively
mirroring the plane across the origin.
Since: 1.2
normalize
Normalizes the vector of the given Plane
,
and adjusts the constant accordingly.
Since: 1.2
transform
Arguments
:: (HasCallStack, MonadIO m) | |
=> Plane |
|
-> Matrix |
|
-> Maybe Matrix |
|
-> m Plane |
Transforms a Plane
p
using the given matrix
and normalMatrix
.
If normalMatrix
is Nothing
, a transformation matrix for the plane
normal will be computed from matrix
. If you are transforming
multiple planes using the same matrix
it's recommended to compute
the normal matrix beforehand to avoid incurring in the cost of
recomputing it every time.
Since: 1.10