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

Description

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

Exported types

newtype Vec4 Source #

Memory-managed wrapper type.

Constructors

Vec4 (ManagedPtr Vec4) 

Instances

Instances details
Eq Vec4 Source # 
Instance details

Defined in GI.Graphene.Structs.Vec4

Methods

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

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

IsGValue Vec4 Source #

Convert Vec4 to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Graphene.Structs.Vec4

ManagedPtrNewtype Vec4 Source # 
Instance details

Defined in GI.Graphene.Structs.Vec4

TypedObject Vec4 Source # 
Instance details

Defined in GI.Graphene.Structs.Vec4

Methods

glibType :: IO GType #

GBoxed Vec4 Source # 
Instance details

Defined in GI.Graphene.Structs.Vec4

HasParentTypes Vec4 Source # 
Instance details

Defined in GI.Graphene.Structs.Vec4

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

Defined in GI.Graphene.Structs.Vec4

Methods

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

type ParentTypes Vec4 Source # 
Instance details

Defined in GI.Graphene.Structs.Vec4

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

newZeroVec4 :: MonadIO m => m Vec4 Source #

Construct a Vec4 struct initialized to zero.

Methods

Overloaded methods

add

vec4Add Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

a: a Vec4

-> Vec4

b: a Vec4

-> m Vec4 

Adds each component of the two given vectors.

Since: 1.0

alloc

vec4Alloc Source #

Arguments

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

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

Allocates a new Vec4 structure.

The contents of the returned structure are undefined.

Use vec4Init to initialize the vector.

Since: 1.0

divide

vec4Divide Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

a: a Vec4

-> Vec4

b: a Vec4

-> m Vec4 

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

vec4Dot Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

a: a Vec4

-> Vec4

b: a Vec4

-> m Float

Returns: the value of the dot product

Computes the dot product of the two given vectors.

Since: 1.0

equal

vec4Equal Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v1: a Vec4

-> Vec4

v2: a Vec4

-> m Bool

Returns: true if the two vectors are equal, and false otherwise

Checks whether the two given Vec4 are equal.

Since: 1.2

free

vec4Free Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a Vec4

-> m () 

Frees the resources allocated by v

Since: 1.0

getW

vec4GetW Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a 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

vec4GetX Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a 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

vec4GetXy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a Vec4

-> m Vec2 

Creates a Vec2 that contains the first two components of the given Vec4.

Since: 1.0

getXyz

vec4GetXyz Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a Vec4

-> m Vec3 

Creates a Vec3 that contains the first three components of the given Vec4.

Since: 1.0

getY

vec4GetY Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a 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

vec4GetZ Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a 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

vec4Init Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a Vec4

-> Float

x: the X field of the vector

-> Float

y: the Y field of the vector

-> Float

z: the Z field of the vector

-> Float

w: the W field of the vector

-> m Vec4

Returns: a pointer to the initialized vector

Initializes a Vec4 using the given values.

This function can be called multiple times.

Since: 1.0

initFromFloat

vec4InitFromFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a Vec4

-> [Float]

src: an array of four floating point values

-> m Vec4

Returns: the initialized vector

Initializes a Vec4 with the values inside the given array.

Since: 1.0

initFromVec2

vec4InitFromVec2 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a Vec4

-> Vec2

src: a Vec2

-> Float

z: the value for the third component of v

-> Float

w: the value for the fourth component of v

-> m Vec4

Returns: the initialized vector

Initializes a Vec4 using the components of a Vec2 and the values of z and w.

Since: 1.0

initFromVec3

vec4InitFromVec3 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a Vec4

-> Vec3

src: a Vec3

-> Float

w: the value for the fourth component of v

-> m Vec4

Returns: the initialized vector

Initializes a Vec4 using the components of a Vec3 and the value of w.

Since: 1.0

initFromVec4

vec4InitFromVec4 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a Vec4

-> Vec4

src: a Vec4

-> m Vec4

Returns: the initialized vector

Initializes a Vec4 using the components of another Vec4.

Since: 1.0

interpolate

vec4Interpolate Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v1: a Vec4

-> Vec4

v2: a Vec4

-> Double

factor: the interpolation factor

-> m Vec4 

Linearly interpolates v1 and v2 using the given factor.

Since: 1.10

length

vec4Length Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a Vec4

-> m Float

Returns: the length of the vector

Computes the length of the given Vec4.

Since: 1.0

max

vec4Max Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

a: a Vec4

-> Vec4

b: a Vec4

-> m Vec4 

Compares each component of the two given vectors and creates a vector that contains the maximum values.

Since: 1.0

min

vec4Min Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

a: a Vec4

-> Vec4

b: a Vec4

-> m Vec4 

Compares each component of the two given vectors and creates a vector that contains the minimum values.

Since: 1.0

multiply

vec4Multiply Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

a: a Vec4

-> Vec4

b: a Vec4

-> m Vec4 

Multiplies each component of the two given vectors.

Since: 1.0

near

vec4Near Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v1: a Vec4

-> Vec4

v2: a Vec4

-> Float

epsilon: the threshold between the two vectors

-> m Bool

Returns: true if the two vectors are near each other

Compares the two given Vec4 vectors and checks whether their values are within the given epsilon.

Since: 1.2

negate

vec4Negate Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a Vec4

-> m Vec4 

Negates the given Vec4.

Since: 1.2

normalize

vec4Normalize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a Vec4

-> m Vec4 

Normalizes the given Vec4.

Since: 1.0

one

vec4One Source #

Arguments

:: (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

vec4Scale Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

v: a Vec4

-> Float

factor: the scalar factor

-> m Vec4 

Multiplies all components of the given vector with the given scalar factor.

Since: 1.2

subtract

vec4Subtract Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec4

a: a Vec4

-> Vec4

b: a Vec4

-> m Vec4 

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

vec4WAxis Source #

Arguments

:: (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

vec4XAxis Source #

Arguments

:: (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

vec4YAxis Source #

Arguments

:: (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

vec4ZAxis Source #

Arguments

:: (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

zero

vec4Zero Source #

Arguments

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

Returns: a constant vector

Retrieves a pointer to a Vec4 with all its components set to 0.

Since: 1.0