gi-graphene-1.0.2: 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.Point3D

Description

A point with three components: X, Y, and Z.

Since: 1.0

Synopsis

Exported types

newtype Point3D Source #

Memory-managed wrapper type.

Constructors

Point3D (ManagedPtr Point3D) 

Instances

Instances details
Eq Point3D Source # 
Instance details

Defined in GI.Graphene.Structs.Point3D

Methods

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

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

IsGValue Point3D Source #

Convert Point3D to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Graphene.Structs.Point3D

ManagedPtrNewtype Point3D Source # 
Instance details

Defined in GI.Graphene.Structs.Point3D

TypedObject Point3D Source # 
Instance details

Defined in GI.Graphene.Structs.Point3D

Methods

glibType :: IO GType #

GBoxed Point3D Source # 
Instance details

Defined in GI.Graphene.Structs.Point3D

HasParentTypes Point3D Source # 
Instance details

Defined in GI.Graphene.Structs.Point3D

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

Defined in GI.Graphene.Structs.Point3D

Methods

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

type ParentTypes Point3D Source # 
Instance details

Defined in GI.Graphene.Structs.Point3D

type ParentTypes Point3D = '[] :: [Type]

newZeroPoint3D :: MonadIO m => m Point3D Source #

Construct a Point3D struct initialized to zero.

Methods

Overloaded methods

alloc

point3DAlloc Source #

Arguments

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

Returns: the newly allocated structure. Use point3DFree to free the resources allocated by this function.

Allocates a Point3D structure.

Since: 1.0

cross

point3DCross Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

a: a Point3D

-> Point3D

b: a Point3D

-> m Point3D 

Computes the cross product of the two given Point3D.

Since: 1.0

distance

point3DDistance Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

a: a Point3D

-> Point3D

b: a Point3D

-> m (Float, Vec3)

Returns: the distance between two points

Computes the distance between the two given Point3D.

Since: 1.4

dot

point3DDot Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

a: a Point3D

-> Point3D

b: a Point3D

-> m Float

Returns: the value of the dot product

Computes the dot product of the two given Point3D.

Since: 1.0

equal

point3DEqual Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

a: a Point3D

-> Point3D

b: a Point3D

-> m Bool

Returns: true if the points are equal

Checks whether two given points are equal.

Since: 1.0

free

point3DFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

p: a Point3D

-> m () 

Frees the resources allocated via point3DAlloc.

Since: 1.0

init

point3DInit Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

p: the Point3D to initialize

-> Float

x: the X coordinate of the point

-> Float

y: the Y coordinate of the point

-> Float

z: the Z coordinate of the point

-> m Point3D

Returns: the initialized Point3D

Initializes a Point3D with the given coordinates.

Since: 1.0

initFromPoint

point3DInitFromPoint Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

p: a Point3D

-> Point3D

src: a Point3D

-> m Point3D

Returns: the initialized point

Initializes a Point3D using the coordinates of another Point3D.

Since: 1.0

initFromVec3

point3DInitFromVec3 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

p: a Point3D

-> Vec3

v: a Vec3

-> m Point3D

Returns: the initialized Point3D

Initializes a Point3D using the components of a Vec3.

Since: 1.0

interpolate

point3DInterpolate Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

a: a Point3D

-> Point3D

b: a Point3D

-> Double

factor: the interpolation factor

-> m Point3D 

Linearly interpolates each component of a and b using the provided factor, and places the result in res.

Since: 1.0

length

point3DLength Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

p: a Point3D

-> m Float

Returns: the length of the vector represented by the point

Computes the length of the vector represented by the coordinates of the given Point3D.

Since: 1.0

near

point3DNear Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

a: a Point3D

-> Point3D

b: a Point3D

-> Float

epsilon: fuzzyness factor

-> m Bool

Returns: true if the points are near each other

Checks whether the two points are near each other, within an epsilon factor.

Since: 1.0

normalize

point3DNormalize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

p: a Point3D

-> m Point3D 

Computes the normalization of the vector represented by the coordinates of the given Point3D.

Since: 1.0

normalizeViewport

point3DNormalizeViewport Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

p: a Point3D

-> Rect

viewport: a Rect representing a viewport

-> Float

zNear: the coordinate of the near clipping plane, or 0 for the default near clipping plane

-> Float

zFar: the coordinate of the far clipping plane, or 1 for the default far clipping plane

-> m Point3D 

Normalizes the coordinates of a Point3D using the given viewport and clipping planes.

The coordinates of the resulting Point3D will be in the [ -1, 1 ] range.

Since: 1.4

scale

point3DScale Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

p: a Point3D

-> Float

factor: the scaling factor

-> m Point3D 

Scales the coordinates of the given Point3D by the given factor.

Since: 1.0

toVec3

point3DToVec3 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Point3D

p: a Point3D

-> m Vec3 

Stores the coordinates of a Point3D into a Vec3.

Since: 1.0

zero

point3DZero Source #

Arguments

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

Returns: a zero point

Retrieves a constant point with all three coordinates set to 0.

Since: 1.0

Properties

x

the X coordinate

getPoint3DX :: MonadIO m => Point3D -> m Float Source #

Get the value of the “x” field. When overloading is enabled, this is equivalent to

get point3D #x

setPoint3DX :: MonadIO m => Point3D -> Float -> m () Source #

Set the value of the “x” field. When overloading is enabled, this is equivalent to

set point3D [ #x := value ]

y

the Y coordinate

getPoint3DY :: MonadIO m => Point3D -> m Float Source #

Get the value of the “y” field. When overloading is enabled, this is equivalent to

get point3D #y

setPoint3DY :: MonadIO m => Point3D -> Float -> m () Source #

Set the value of the “y” field. When overloading is enabled, this is equivalent to

set point3D [ #y := value ]

z

the Z coordinate

getPoint3DZ :: MonadIO m => Point3D -> m Float Source #

Get the value of the “z” field. When overloading is enabled, this is equivalent to

get point3D #z

setPoint3DZ :: MonadIO m => Point3D -> Float -> m () Source #

Set the value of the “z” field. When overloading is enabled, this is equivalent to

set point3D [ #z := value ]