gi-graphene-1.0.1: 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.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

Exported types

newtype Vec3 Source #

Memory-managed wrapper type.

Constructors

Vec3 (ManagedPtr Vec3) 

Instances

Instances details
Eq Vec3 Source # 
Instance details

Defined in GI.Graphene.Structs.Vec3

Methods

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

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

BoxedObject Vec3 Source # 
Instance details

Defined in GI.Graphene.Structs.Vec3

Methods

boxedType :: Vec3 -> IO GType #

IsGValue Vec3 Source #

Convert Vec3 to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Graphene.Structs.Vec3

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

Defined in GI.Graphene.Structs.Vec3

Methods

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

newZeroVec3 :: MonadIO m => m Vec3 Source #

Construct a Vec3 struct initialized to zero.

noVec3 :: Maybe Vec3 Source #

A convenience alias for Nothing :: Maybe Vec3.

Methods

Overloaded methods

add

vec3Add Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

a: a Vec3

-> Vec3

b: a Vec3

-> m Vec3 

Adds each component of the two given vectors.

Since: 1.0

alloc

vec3Alloc Source #

Arguments

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

Returns: the newly allocated Vec3 structure. Use vec3Free to free the resources allocated by this function.

Allocates a new Vec3 structure.

The contents of the returned structure are undefined.

Use vec3Init to initialize the vector.

Since: 1.0

cross

vec3Cross Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

a: a Vec3

-> Vec3

b: a Vec3

-> m Vec3 

Computes the cross product of the two given vectors.

Since: 1.0

divide

vec3Divide Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

a: a Vec3

-> Vec3

b: a Vec3

-> m Vec3 

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

vec3Dot Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

a: a Vec3

-> Vec3

b: a Vec3

-> m Float

Returns: the value of the dot product

Computes the dot product of the two given vectors.

Since: 1.0

equal

vec3Equal Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v1: a Vec3

-> Vec3

v2: a Vec3

-> m Bool

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

Checks whether the two given Vec3 are equal.

Since: 1.2

free

vec3Free Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> m () 

Frees the resources allocated by v

Since: 1.0

getX

vec3GetX Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

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

vec3GetXy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> m Vec2 

Creates a Vec2 that contains the first and second components of the given Vec3.

Since: 1.0

getXy0

vec3GetXy0 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> m Vec3 

Creates a Vec3 that contains the first two components of the given Vec3, and the third component set to 0.

Since: 1.0

getXyz0

vec3GetXyz0 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> m Vec4 

Converts a Vec3 in a Vec4 using 0.0 as the value for the fourth component of the resulting vector.

Since: 1.0

getXyz1

vec3GetXyz1 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> m Vec4 

Converts a Vec3 in a Vec4 using 1.0 as the value for the fourth component of the resulting vector.

Since: 1.0

getXyzw

vec3GetXyzw Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> Float

w: the value of the W component

-> m Vec4 

Converts a Vec3 in a Vec4 using w as the value of the fourth component of the resulting vector.

Since: 1.0

getY

vec3GetY Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

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

vec3GetZ Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

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

vec3Init Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> Float

x: the X field of the vector

-> Float

y: the Y field of the vector

-> Float

z: the Z field of the vector

-> m Vec3

Returns: a pointer to the initialized vector

Initializes a Vec3 using the given values.

This function can be called multiple times.

Since: 1.0

initFromFloat

vec3InitFromFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> [Float]

src: an array of 3 floating point values

-> m Vec3

Returns: the initialized vector

Initializes a Vec3 with the values from an array.

Since: 1.0

initFromVec3

vec3InitFromVec3 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> Vec3

src: a Vec3

-> m Vec3

Returns: the initialized vector

Initializes a Vec3 with the values of another Vec3.

Since: 1.0

length

vec3Length Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> m Float

Returns: the value of the length of the vector

Retrieves the length of the given vector v.

Since: 1.0

max

vec3Max Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

a: a Vec3

-> Vec3

b: a Vec3

-> m Vec3 

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

Since: 1.0

min

vec3Min Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

a: a Vec3

-> Vec3

b: a Vec3

-> m Vec3 

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

Since: 1.0

multiply

vec3Multiply Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

a: a Vec3

-> Vec3

b: a Vec3

-> m Vec3 

Multiplies each component of the two given vectors.

Since: 1.0

near

vec3Near Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v1: a Vec3

-> Vec3

v2: a Vec3

-> Float

epsilon: the threshold between the two vectors

-> m Bool

Returns: true if the two vectors are near each other

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

Since: 1.2

negate

vec3Negate Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> m Vec3 

Negates the given Vec3.

Since: 1.2

normalize

vec3Normalize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> m Vec3 

Normalizes the given Vec3.

Since: 1.0

one

vec3One Source #

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

vec3Scale Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

v: a Vec3

-> Float

factor: the scalar factor

-> m Vec3 

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

Since: 1.2

subtract

vec3Subtract Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Vec3

a: a Vec3

-> Vec3

b: a Vec3

-> m Vec3 

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

vec3XAxis Source #

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

vec3YAxis Source #

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

vec3ZAxis Source #

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

zero

vec3Zero Source #

Arguments

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

Returns: a constant vector

Provides a constant pointer to a vector with three components, all sets to 0.

Since: 1.0