Vec4

A structure capable of holding a vector with four dimensions: x, y, z, and w.

The contents of the #graphene_vec4_t structure are private and should never be accessed directly.

Constructors

this
this(graphene_vec4_t* graphene_vec4, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Allocates a new #graphene_vec4_t structure.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

add
void add(Vec4 b, Vec4 res)

Adds each component of the two given vectors.

divide
void divide(Vec4 b, Vec4 res)

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.

dot
float dot(Vec4 b)

Computes the dot product of the two given vectors.

equal
bool equal(Vec4 v2)

Checks whether the two given #graphene_vec4_t are equal.

free
void free()

Frees the resources allocated by @v

getStruct
void* getStruct()

the main Gtk struct as a void*

getVec4Struct
graphene_vec4_t* getVec4Struct(bool transferOwnership)

Get the main Gtk struct

getW
float getW()

Retrieves the value of the fourth component of the given #graphene_vec4_t.

getX
float getX()

Retrieves the value of the first component of the given #graphene_vec4_t.

getXy
void getXy(Vec2 res)

Creates a #graphene_vec2_t that contains the first two components of the given #graphene_vec4_t.

getXyz
void getXyz(Vec3 res)

Creates a #graphene_vec3_t that contains the first three components of the given #graphene_vec4_t.

getY
float getY()

Retrieves the value of the second component of the given #graphene_vec4_t.

getZ
float getZ()

Retrieves the value of the third component of the given #graphene_vec4_t.

init
Vec4 init(float x, float y, float z, float w)

Initializes a #graphene_vec4_t using the given values.

initFromFloat
Vec4 initFromFloat(float[4] src)

Initializes a #graphene_vec4_t with the values inside the given array.

initFromVec2
Vec4 initFromVec2(Vec2 src, float z, float w)

Initializes a #graphene_vec4_t using the components of a #graphene_vec2_t and the values of @z and @w.

initFromVec3
Vec4 initFromVec3(Vec3 src, float w)

Initializes a #graphene_vec4_t using the components of a #graphene_vec3_t and the value of @w.

initFromVec4
Vec4 initFromVec4(Vec4 src)

Initializes a #graphene_vec4_t using the components of another #graphene_vec4_t.

interpolate
void interpolate(Vec4 v2, double factor, Vec4 res)

Linearly interpolates @v1 and @v2 using the given @factor.

length
float length()

Computes the length of the given #graphene_vec4_t.

max
void max(Vec4 b, Vec4 res)

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

min
void min(Vec4 b, Vec4 res)

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

multiply
void multiply(Vec4 b, Vec4 res)

Multiplies each component of the two given vectors.

near
bool near(Vec4 v2, float epsilon)

Compares the two given #graphene_vec4_t vectors and checks whether their values are within the given @epsilon.

negate
void negate(Vec4 res)

Negates the given #graphene_vec4_t.

normalize
void normalize(Vec4 res)

Normalizes the given #graphene_vec4_t.

scale
void scale(float factor, Vec4 res)

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

subtract
void subtract(Vec4 b, Vec4 res)

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.

toFloat
void toFloat(float[4] dest)

Stores the components of the given #graphene_vec4_t into an array of floating point values.

Static functions

getType
GType getType()
one
Vec4 one()

Retrieves a pointer to a #graphene_vec4_t with all its components set to 1.

wAxis
Vec4 wAxis()

Retrieves a pointer to a #graphene_vec4_t with its components set to (0, 0, 0, 1).

xAxis
Vec4 xAxis()

Retrieves a pointer to a #graphene_vec4_t with its components set to (1, 0, 0, 0).

yAxis
Vec4 yAxis()

Retrieves a pointer to a #graphene_vec4_t with its components set to (0, 1, 0, 0).

zAxis
Vec4 zAxis()

Retrieves a pointer to a #graphene_vec4_t with its components set to (0, 0, 1, 0).

zero
Vec4 zero()

Retrieves a pointer to a #graphene_vec4_t with all its components set to 0.

Variables

graphene_vec4
graphene_vec4_t* graphene_vec4;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta