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 |
A structure capable of holding a vector with four dimensions: x, y, z, and w.
The contents of the Vec4
structure are private and should
never be accessed directly.
Synopsis
- newtype Vec4 = Vec4 (ManagedPtr Vec4)
- newZeroVec4 :: MonadIO m => m Vec4
- vec4Add :: (HasCallStack, MonadIO m) => Vec4 -> Vec4 -> m Vec4
- vec4Alloc :: (HasCallStack, MonadIO m) => m Vec4
- vec4Divide :: (HasCallStack, MonadIO m) => Vec4 -> Vec4 -> m Vec4
- vec4Dot :: (HasCallStack, MonadIO m) => Vec4 -> Vec4 -> m Float
- vec4Equal :: (HasCallStack, MonadIO m) => Vec4 -> Vec4 -> m Bool
- vec4Free :: (HasCallStack, MonadIO m) => Vec4 -> m ()
- vec4GetW :: (HasCallStack, MonadIO m) => Vec4 -> m Float
- vec4GetX :: (HasCallStack, MonadIO m) => Vec4 -> m Float
- vec4GetXy :: (HasCallStack, MonadIO m) => Vec4 -> m Vec2
- vec4GetXyz :: (HasCallStack, MonadIO m) => Vec4 -> m Vec3
- vec4GetY :: (HasCallStack, MonadIO m) => Vec4 -> m Float
- vec4GetZ :: (HasCallStack, MonadIO m) => Vec4 -> m Float
- vec4Init :: (HasCallStack, MonadIO m) => Vec4 -> Float -> Float -> Float -> Float -> m Vec4
- vec4InitFromFloat :: (HasCallStack, MonadIO m) => Vec4 -> [Float] -> m Vec4
- vec4InitFromVec2 :: (HasCallStack, MonadIO m) => Vec4 -> Vec2 -> Float -> Float -> m Vec4
- vec4InitFromVec3 :: (HasCallStack, MonadIO m) => Vec4 -> Vec3 -> Float -> m Vec4
- vec4InitFromVec4 :: (HasCallStack, MonadIO m) => Vec4 -> Vec4 -> m Vec4
- vec4Interpolate :: (HasCallStack, MonadIO m) => Vec4 -> Vec4 -> Double -> m Vec4
- vec4Length :: (HasCallStack, MonadIO m) => Vec4 -> m Float
- vec4Max :: (HasCallStack, MonadIO m) => Vec4 -> Vec4 -> m Vec4
- vec4Min :: (HasCallStack, MonadIO m) => Vec4 -> Vec4 -> m Vec4
- vec4Multiply :: (HasCallStack, MonadIO m) => Vec4 -> Vec4 -> m Vec4
- vec4Near :: (HasCallStack, MonadIO m) => Vec4 -> Vec4 -> Float -> m Bool
- vec4Negate :: (HasCallStack, MonadIO m) => Vec4 -> m Vec4
- vec4Normalize :: (HasCallStack, MonadIO m) => Vec4 -> m Vec4
- vec4One :: (HasCallStack, MonadIO m) => m Vec4
- vec4Scale :: (HasCallStack, MonadIO m) => Vec4 -> Float -> m Vec4
- vec4Subtract :: (HasCallStack, MonadIO m) => Vec4 -> Vec4 -> m Vec4
- vec4WAxis :: (HasCallStack, MonadIO m) => m Vec4
- vec4XAxis :: (HasCallStack, MonadIO m) => m Vec4
- vec4YAxis :: (HasCallStack, MonadIO m) => m Vec4
- vec4ZAxis :: (HasCallStack, MonadIO m) => m Vec4
- vec4Zero :: (HasCallStack, MonadIO m) => m Vec4
Exported types
Memory-managed wrapper type.
Instances
Eq Vec4 Source # | |
GBoxed Vec4 Source # | |
Defined in GI.Graphene.Structs.Vec4 | |
ManagedPtrNewtype Vec4 Source # | |
Defined in GI.Graphene.Structs.Vec4 toManagedPtr :: Vec4 -> ManagedPtr Vec4 | |
TypedObject Vec4 Source # | |
Defined in GI.Graphene.Structs.Vec4 | |
HasParentTypes Vec4 Source # | |
Defined in GI.Graphene.Structs.Vec4 | |
tag ~ 'AttrSet => Constructible Vec4 tag Source # | |
IsGValue (Maybe Vec4) Source # | Convert |
Defined in GI.Graphene.Structs.Vec4 gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Vec4 -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Vec4) | |
type ParentTypes Vec4 Source # | |
Defined in GI.Graphene.Structs.Vec4 |
Methods
Click to display all available methods, including inherited ones
add
Adds each component of the two given vectors.
Since: 1.0
alloc
:: (HasCallStack, MonadIO m) | |
=> m Vec4 | Returns: the newly allocated |
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
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> Vec4 |
|
-> m Float | Returns: the value of the dot product |
Computes the dot product of the two given vectors.
Since: 1.0
equal
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> Vec4 |
|
-> m Bool | Returns: |
Checks whether the two given Vec4
are equal.
Since: 1.2
free
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> m () |
Frees the resources allocated by v
Since: 1.0
getW
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> m Float | Returns: the value of the fourth component |
Retrieves the value of the fourth component of the given Vec4
.
Since: 1.0
getX
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> m Float | Returns: the value of the first component |
Retrieves the value of the first component of the given Vec4
.
Since: 1.0
getXy
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> m Vec2 |
getXyz
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> m Vec3 |
getY
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> m Float | Returns: the value of the second component |
Retrieves the value of the second component of the given Vec4
.
Since: 1.0
getZ
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> m Float | Returns: the value of the third component |
Retrieves the value of the third component of the given Vec4
.
Since: 1.0
init
initFromFloat
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> [Float] |
|
-> m Vec4 | Returns: the initialized vector |
Initializes a Vec4
with the values inside the given array.
Since: 1.0
initFromVec2
initFromVec3
initFromVec4
interpolate
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> Vec4 |
|
-> Double |
|
-> m Vec4 |
Linearly interpolates v1
and v2
using the given factor
.
Since: 1.10
length
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> m Float | Returns: the length of the vector |
Computes the length of the given Vec4
.
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
:: (HasCallStack, MonadIO m) | |
=> Vec4 |
|
-> Vec4 |
|
-> Float |
|
-> m Bool | Returns: |
Compares the two given Vec4
vectors and checks
whether their values are within the given epsilon
.
Since: 1.2
negate
normalize
one
:: (HasCallStack, MonadIO m) | |
=> m Vec4 | Returns: a constant vector |
Retrieves a pointer to a Vec4
with all its
components set 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
wAxis
:: (HasCallStack, MonadIO m) | |
=> m Vec4 | Returns: a constant vector |
Retrieves a pointer to a Vec4
with its
components set to (0, 0, 0, 1).
Since: 1.0
xAxis
:: (HasCallStack, MonadIO m) | |
=> m Vec4 | Returns: a constant vector |
Retrieves a pointer to a Vec4
with its
components set to (1, 0, 0, 0).
Since: 1.0
yAxis
:: (HasCallStack, MonadIO m) | |
=> m Vec4 | Returns: a constant vector |
Retrieves a pointer to a Vec4
with its
components set to (0, 1, 0, 0).
Since: 1.0
zAxis
:: (HasCallStack, MonadIO m) | |
=> m Vec4 | Returns: a constant vector |
Retrieves a pointer to a Vec4
with its
components set to (0, 0, 1, 0).
Since: 1.0