| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.Graphene.Structs.Vec3
Description
A structure capable of holding a vector with three dimensions: x, y, and z.
The contents of the Vec3 structure are private and should
never be accessed directly.
Synopsis
- newtype Vec3 = Vec3 (ManagedPtr Vec3)
- newZeroVec3 :: MonadIO m => m Vec3
- vec3Add :: (HasCallStack, MonadIO m) => Vec3 -> Vec3 -> m Vec3
- vec3Alloc :: (HasCallStack, MonadIO m) => m Vec3
- vec3Cross :: (HasCallStack, MonadIO m) => Vec3 -> Vec3 -> m Vec3
- vec3Divide :: (HasCallStack, MonadIO m) => Vec3 -> Vec3 -> m Vec3
- vec3Dot :: (HasCallStack, MonadIO m) => Vec3 -> Vec3 -> m Float
- vec3Equal :: (HasCallStack, MonadIO m) => Vec3 -> Vec3 -> m Bool
- vec3Free :: (HasCallStack, MonadIO m) => Vec3 -> m ()
- vec3GetX :: (HasCallStack, MonadIO m) => Vec3 -> m Float
- vec3GetXy :: (HasCallStack, MonadIO m) => Vec3 -> m Vec2
- vec3GetXy0 :: (HasCallStack, MonadIO m) => Vec3 -> m Vec3
- vec3GetXyz0 :: (HasCallStack, MonadIO m) => Vec3 -> m Vec4
- vec3GetXyz1 :: (HasCallStack, MonadIO m) => Vec3 -> m Vec4
- vec3GetXyzw :: (HasCallStack, MonadIO m) => Vec3 -> Float -> m Vec4
- vec3GetY :: (HasCallStack, MonadIO m) => Vec3 -> m Float
- vec3GetZ :: (HasCallStack, MonadIO m) => Vec3 -> m Float
- vec3Init :: (HasCallStack, MonadIO m) => Vec3 -> Float -> Float -> Float -> m Vec3
- vec3InitFromFloat :: (HasCallStack, MonadIO m) => Vec3 -> [Float] -> m Vec3
- vec3InitFromVec3 :: (HasCallStack, MonadIO m) => Vec3 -> Vec3 -> m Vec3
- vec3Interpolate :: (HasCallStack, MonadIO m) => Vec3 -> Vec3 -> Double -> m Vec3
- vec3Length :: (HasCallStack, MonadIO m) => Vec3 -> m Float
- vec3Max :: (HasCallStack, MonadIO m) => Vec3 -> Vec3 -> m Vec3
- vec3Min :: (HasCallStack, MonadIO m) => Vec3 -> Vec3 -> m Vec3
- vec3Multiply :: (HasCallStack, MonadIO m) => Vec3 -> Vec3 -> m Vec3
- vec3Near :: (HasCallStack, MonadIO m) => Vec3 -> Vec3 -> Float -> m Bool
- vec3Negate :: (HasCallStack, MonadIO m) => Vec3 -> m Vec3
- vec3Normalize :: (HasCallStack, MonadIO m) => Vec3 -> m Vec3
- vec3One :: (HasCallStack, MonadIO m) => m Vec3
- vec3Scale :: (HasCallStack, MonadIO m) => Vec3 -> Float -> m Vec3
- vec3Subtract :: (HasCallStack, MonadIO m) => Vec3 -> Vec3 -> m Vec3
- vec3XAxis :: (HasCallStack, MonadIO m) => m Vec3
- vec3YAxis :: (HasCallStack, MonadIO m) => m Vec3
- vec3ZAxis :: (HasCallStack, MonadIO m) => m Vec3
- vec3Zero :: (HasCallStack, MonadIO m) => m Vec3
Exported types
Memory-managed wrapper type.
Instances
| Eq Vec3 Source # | |
| GBoxed Vec3 Source # | |
Defined in GI.Graphene.Structs.Vec3 | |
| ManagedPtrNewtype Vec3 Source # | |
Defined in GI.Graphene.Structs.Vec3 Methods toManagedPtr :: Vec3 -> ManagedPtr Vec3 | |
| TypedObject Vec3 Source # | |
Defined in GI.Graphene.Structs.Vec3 | |
| HasParentTypes Vec3 Source # | |
Defined in GI.Graphene.Structs.Vec3 | |
| tag ~ 'AttrSet => Constructible Vec3 tag Source # | |
| IsGValue (Maybe Vec3) Source # | Convert |
Defined in GI.Graphene.Structs.Vec3 Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Vec3 -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Vec3) | |
| type ParentTypes Vec3 Source # | |
Defined in GI.Graphene.Structs.Vec3 | |
Methods
Click to display all available methods, including inherited ones
add
Adds each component of the two given vectors.
Since: 1.0
alloc
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Vec3 | Returns: the newly allocated |
cross
Computes the cross product of the two given vectors.
Since: 1.0
divide
Divides each component of the first operand a by the corresponding
component of the second operand b, and places the results into the
vector res.
Since: 1.0
dot
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> Vec3 |
|
| -> m Float | Returns: the value of the dot product |
Computes the dot product of the two given vectors.
Since: 1.0
equal
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> Vec3 |
|
| -> m Bool | Returns: |
Checks whether the two given Vec3 are equal.
Since: 1.2
free
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> m () |
Frees the resources allocated by v
Since: 1.0
getX
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> m Float | Returns: the value of the first component of the vector |
Retrieves the first component of the given vector v.
Since: 1.0
getXy
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> m Vec2 |
getXy0
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> m Vec3 |
getXyz0
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> m Vec4 |
getXyz1
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> m Vec4 |
getXyzw
getY
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> m Float | Returns: the value of the second component of the vector |
Retrieves the second component of the given vector v.
Since: 1.0
getZ
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> m Float | Returns: the value of the third component of the vector |
Retrieves the third component of the given vector v.
Since: 1.0
init
initFromFloat
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> [Float] |
|
| -> m Vec3 | Returns: the initialized vector |
Initializes a Vec3 with the values from an array.
Since: 1.0
initFromVec3
interpolate
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> Vec3 |
|
| -> Double |
|
| -> m Vec3 |
Linearly interpolates v1 and v2 using the given factor.
Since: 1.10
length
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> m Float | Returns: the value of the length of the vector |
Retrieves the length of the given vector v.
Since: 1.0
max
Compares each component of the two given vectors and creates a vector that contains the maximum values.
Since: 1.0
min
Compares each component of the two given vectors and creates a vector that contains the minimum values.
Since: 1.0
multiply
Multiplies each component of the two given vectors.
Since: 1.0
near
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> Vec3 |
|
| -> Float |
|
| -> m Bool | Returns: |
Compares the two given Vec3 vectors and checks
whether their values are within the given epsilon.
Since: 1.2
negate
normalize
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Vec3 |
|
| -> m Vec3 |
Normalizes the given Vec3.
Since: 1.0
one
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Vec3 | Returns: a constant vector |
Provides a constant pointer to a vector with three components, all sets to 1.
Since: 1.0
scale
Multiplies all components of the given vector with the given scalar factor.
Since: 1.2
subtract
Subtracts from each component of the first operand a the
corresponding component of the second operand b and places
each result into the components of res.
Since: 1.0
xAxis
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Vec3 | Returns: a constant vector |
Provides a constant pointer to a vector with three components with values set to (1, 0, 0).
Since: 1.0
yAxis
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Vec3 | Returns: a constant vector |
Provides a constant pointer to a vector with three components with values set to (0, 1, 0).
Since: 1.0
zAxis
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Vec3 | Returns: a constant vector |
Provides a constant pointer to a vector with three components with values set to (0, 0, 1).
Since: 1.0