| 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 |
GI.Graphene.Structs.Point3D
Description
A point with three components: X, Y, and Z.
Since: 1.0
Synopsis
- newtype Point3D = Point3D (ManagedPtr Point3D)
- newZeroPoint3D :: MonadIO m => m Point3D
- noPoint3D :: Maybe 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
Memory-managed wrapper type.
Constructors
| Point3D (ManagedPtr Point3D) |
Methods
Overloaded methods
alloc
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Point3D | Returns: the newly allocated structure.
Use |
Allocates a Point3D structure.
Since: 1.0
cross
Computes the cross product of the two given Point3D.
Since: 1.0
distance
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Point3D |
|
| -> Point3D |
|
| -> m (Float, Vec3) | Returns: the distance between two points |
Computes the distance between the two given Point3D.
Since: 1.4
dot
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Point3D |
|
| -> Point3D |
|
| -> m Float | Returns: the value of the dot product |
Computes the dot product of the two given Point3D.
Since: 1.0
equal
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Point3D |
|
| -> Point3D |
|
| -> m Bool | Returns: |
Checks whether two given points are equal.
Since: 1.0
free
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Point3D |
|
| -> m () |
Frees the resources allocated via point3DAlloc.
Since: 1.0
init
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Point3D |
|
| -> Float |
|
| -> Float |
|
| -> Float |
|
| -> m Point3D | Returns: the initialized |
Initializes a Point3D with the given coordinates.
Since: 1.0
initFromPoint
initFromVec3
interpolate
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Point3D |
|
| -> Point3D |
|
| -> Double |
|
| -> m Point3D |
Linearly interpolates each component of a and b using the
provided factor, and places the result in res.
Since: 1.0
length
Arguments
| :: (HasCallStack, MonadIO m) | |
| => 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
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Point3D |
|
| -> Point3D |
|
| -> Float |
|
| -> m Bool | Returns: |
Checks whether the two points are near each other, within
an epsilon factor.
Since: 1.0
normalize
Arguments
| :: (HasCallStack, MonadIO m) | |
| => 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 |
|
| -> Rect |
|
| -> Float |
|
| -> Float |
|
| -> m Point3D |
scale
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Point3D |
|
| -> Float |
|
| -> m Point3D |
Scales the coordinates of the given Point3D by
the given factor.
Since: 1.0
toVec3
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Point3D |
|
| -> m Vec3 |
zero
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
setpoint3D [ #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
setpoint3D [ #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
setpoint3D [ #z:=value ]