gi-graphene-1.0.1: Graphene bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

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

Exported types

newtype Plane Source #

Memory-managed wrapper type.

Constructors

Plane (ManagedPtr Plane) 

Instances

Instances details
Eq Plane Source # 
Instance details

Defined in GI.Graphene.Structs.Plane

Methods

(==) :: Plane -> Plane -> Bool #

(/=) :: Plane -> Plane -> Bool #

BoxedObject Plane Source # 
Instance details

Defined in GI.Graphene.Structs.Plane

Methods

boxedType :: Plane -> IO GType #

IsGValue Plane Source #

Convert Plane to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Graphene.Structs.Plane

tag ~ 'AttrSet => Constructible Plane tag Source # 
Instance details

Defined in GI.Graphene.Structs.Plane

Methods

new :: MonadIO m => (ManagedPtr Plane -> Plane) -> [AttrOp Plane tag] -> m Plane #

newZeroPlane :: MonadIO m => m Plane Source #

Construct a Plane struct initialized to zero.

noPlane :: Maybe Plane Source #

A convenience alias for Nothing :: Maybe Plane.

Methods

Overloaded methods

alloc

planeAlloc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Plane

Returns: the newly allocated Plane. Use planeFree to free the resources allocated by this function

Allocates a new Plane structure.

The contents of the returned structure are undefined.

Since: 1.2

distance

planeDistance Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Plane

p: a Plane

-> Point3D

point: a Point3D

-> m Float

Returns: the distance of the given Point3D from the plane

Computes the distance of point from a Plane.

Since: 1.2

equal

planeEqual Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Plane

a: a Plane

-> Plane

b: a Plane

-> m Bool

Returns: true if the given planes are equal

Checks whether the two given Plane are equal.

Since: 1.2

free

planeFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Plane

p: a Plane

-> m () 

Frees the resources allocated by planeAlloc.

Since: 1.2

getConstant

planeGetConstant Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Plane

p: a 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

planeGetNormal Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Plane

p: a Plane

-> m Vec3 

Retrieves the normal vector pointing towards the origin of the given Plane.

Since: 1.2

init

planeInit Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Plane

p: the Plane to initialize

-> Maybe Vec3

normal: a unit length normal vector defining the plane pointing towards the origin; if unset, we use the X axis by default

-> Float

constant: the distance from the origin to the plane along the normal vector; the sign determines the half-space occupied by the plane

-> m Plane

Returns: the initialized plane

Initializes the given Plane using the given normal vector and constant values.

Since: 1.2

initFromPlane

planeInitFromPlane Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Plane

p: the Plane to initialize

-> Plane

src: a Plane

-> m Plane

Returns: the initialized plane

Initializes the given Plane using the normal vector and constant of another Plane.

Since: 1.2

initFromPoint

planeInitFromPoint Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Plane

p: the Plane to initialize

-> Vec3

normal: a normal vector defining the plane pointing towards the origin

-> Point3D

point: a 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

planeInitFromPoints Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Plane

p: the Plane to initialize

-> Point3D

a: a Point3D

-> Point3D

b: a Point3D

-> Point3D

c: a 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

planeInitFromVec4 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Plane

p: the Plane to initialize

-> Vec4

src: a Vec4 containing the normal vector in its first three components, and the distance in its fourth component

-> m Plane

Returns: the initialized plane

Initializes the given Plane using the components of the given Vec4 vector.

Since: 1.2

negate

planeNegate Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Plane

p: a Plane

-> m Plane 

Negates the normal vector and constant of a Plane, effectively mirroring the plane across the origin.

Since: 1.2

normalize

planeNormalize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Plane

p: a Plane

-> m Plane 

Normalizes the vector of the given Plane, and adjusts the constant accordingly.

Since: 1.2