Vec3

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

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

Constructors

this
this(graphene_vec3_t* graphene_vec3, bool ownedRef)

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

this
this()

Allocates a new #graphene_vec3_t structure.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

add
void add(Vec3 b, Vec3 res)

Adds each component of the two given vectors.

cross
void cross(Vec3 b, Vec3 res)

Computes the cross product of the two given vectors.

divide
void divide(Vec3 b, Vec3 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(Vec3 b)

Computes the dot product of the two given vectors.

equal
bool equal(Vec3 v2)

Checks whether the two given #graphene_vec3_t are equal.

free
void free()

Frees the resources allocated by @v

getStruct
void* getStruct()

the main Gtk struct as a void*

getVec3Struct
graphene_vec3_t* getVec3Struct(bool transferOwnership)

Get the main Gtk struct

getX
float getX()

Retrieves the first component of the given vector @v.

getXy
void getXy(Vec2 res)

Creates a #graphene_vec2_t that contains the first and second components of the given #graphene_vec3_t.

getXy0
void getXy0(Vec3 res)

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

getXyz0
void getXyz0(Vec4 res)

Converts a #graphene_vec3_t in a #graphene_vec4_t using 0.0 as the value for the fourth component of the resulting vector.

getXyz1
void getXyz1(Vec4 res)

Converts a #graphene_vec3_t in a #graphene_vec4_t using 1.0 as the value for the fourth component of the resulting vector.

getXyzw
void getXyzw(float w, Vec4 res)

Converts a #graphene_vec3_t in a #graphene_vec4_t using @w as the value of the fourth component of the resulting vector.

getY
float getY()

Retrieves the second component of the given vector @v.

getZ
float getZ()

Retrieves the third component of the given vector @v.

init
Vec3 init(float x, float y, float z)

Initializes a #graphene_vec3_t using the given values.

initFromFloat
Vec3 initFromFloat(float[3] src)

Initializes a #graphene_vec3_t with the values from an array.

initFromVec3
Vec3 initFromVec3(Vec3 src)

Initializes a #graphene_vec3_t with the values of another #graphene_vec3_t.

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

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

length
float length()

Retrieves the length of the given vector @v.

max
void max(Vec3 b, Vec3 res)

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

min
void min(Vec3 b, Vec3 res)

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

multiply
void multiply(Vec3 b, Vec3 res)

Multiplies each component of the two given vectors.

near
bool near(Vec3 v2, float epsilon)

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

negate
void negate(Vec3 res)

Negates the given #graphene_vec3_t.

normalize
void normalize(Vec3 res)

Normalizes the given #graphene_vec3_t.

scale
void scale(float factor, Vec3 res)

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

subtract
void subtract(Vec3 b, Vec3 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[3] dest)

Copies the components of a #graphene_vec3_t into the given array.

Static functions

getType
GType getType()
one
Vec3 one()

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

xAxis
Vec3 xAxis()

Provides a constant pointer to a vector with three components with values set to (1, 0, 0).

yAxis
Vec3 yAxis()

Provides a constant pointer to a vector with three components with values set to (0, 1, 0).

zAxis
Vec3 zAxis()

Provides a constant pointer to a vector with three components with values set to (0, 0, 1).

zero
Vec3 zero()

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

Variables

graphene_vec3
graphene_vec3_t* graphene_vec3;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta