gi-graphene-1.0.8: Graphene bindings

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.Point3D

Contents

- Exported types
- Methods
  - alloc
  - cross
  - distance
  - dot
  - equal
  - free
  - init
  - initFromPoint
  - initFromVec3
  - interpolate
  - length
  - near
  - normalize
  - normalizeViewport
  - scale
  - toVec3
  - zero
- Properties
  - x
  - y
  - z

Description

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

Since: 1.0

Synopsis

- newtype Point3D = Point3D (ManagedPtr Point3D)
- newZeroPoint3D :: MonadIO m => m Point3D
- point3DAlloc :: (HasCallStack, MonadIO m) => m Point3D
- point3DCross :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> m Point3D
- point3DDistance :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> m (Float, Vec3)
- point3DDot :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> m Float
- point3DEqual :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> m Bool
- point3DFree :: (HasCallStack, MonadIO m) => Point3D -> m ()
- point3DInit :: (HasCallStack, MonadIO m) => Point3D -> Float -> Float -> Float -> m Point3D
- point3DInitFromPoint :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> m Point3D
- point3DInitFromVec3 :: (HasCallStack, MonadIO m) => Point3D -> Vec3 -> m Point3D
- point3DInterpolate :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> Double -> m Point3D
- point3DLength :: (HasCallStack, MonadIO m) => Point3D -> m Float
- point3DNear :: (HasCallStack, MonadIO m) => Point3D -> Point3D -> Float -> m Bool
- point3DNormalize :: (HasCallStack, MonadIO m) => Point3D -> m Point3D
- point3DNormalizeViewport :: (HasCallStack, MonadIO m) => Point3D -> Rect -> Float -> Float -> m Point3D
- point3DScale :: (HasCallStack, MonadIO m) => Point3D -> Float -> m Point3D
- point3DToVec3 :: (HasCallStack, MonadIO m) => Point3D -> m Vec3
- point3DZero :: (HasCallStack, MonadIO m) => m Point3D
- getPoint3DX :: MonadIO m => Point3D -> m Float
- setPoint3DX :: MonadIO m => Point3D -> Float -> m ()
- getPoint3DY :: MonadIO m => Point3D -> m Float
- setPoint3DY :: MonadIO m => Point3D -> Float -> m ()
- getPoint3DZ :: MonadIO m => Point3D -> m Float
- setPoint3DZ :: MonadIO m => Point3D -> Float -> m ()

# 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 Source # (/=) :: Point3D -> Point3D -> Bool Source #
GBoxed Point3D Source # |
Instance details Defined in GI.Graphene.Structs.Point3D
ManagedPtrNewtype Point3D Source # |
Instance details Defined in GI.Graphene.Structs.Point3D Methods toManagedPtr :: Point3D -> ManagedPtr Point3D Source #
TypedObject Point3D Source # |
Instance details Defined in GI.Graphene.Structs.Point3D Methods glibType :: IO GType Source #
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 Source #
IsGValue (Maybe Point3D) Source # | Convert `Point3D` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Graphene.Structs.Point3D Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Point3D -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Point3D) Source #
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

### Click to display all available methods, including inherited ones

Expand

#### Methods

cross, distance, dot, equal, free, init, initFromPoint, initFromVec3, interpolate, length, near, normalize, normalizeViewport, scale, toVec3.

#### Getters

None.

#### Setters

None.

## 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 ]