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.

Members

Functions

add
void add(graphene.vec3.Vec3 b, graphene.vec3.Vec3 res)

Adds each component of the two given vectors.

cross
void cross(graphene.vec3.Vec3 b, graphene.vec3.Vec3 res)

Computes the cross product of the two given vectors.

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

Computes the dot product of the two given vectors.

equal
bool equal(graphene.vec3.Vec3 v2)

Checks whether the two given #graphene_vec3_t are equal.

getX
float getX()

Retrieves the first component of the given vector v.

getXy
void getXy(graphene.vec2.Vec2 res)

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

getXy0
void getXy0(graphene.vec3.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(graphene.vec4.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(graphene.vec4.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, graphene.vec4.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.

initFromFloat
graphene.vec3.Vec3 initFromFloat(float[] src)

Initializes a #graphene_vec3_t with the values from an array.

initFromVec3
graphene.vec3.Vec3 initFromVec3(graphene.vec3.Vec3 src)

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

init_
graphene.vec3.Vec3 init_(float x, float y, float z)

Initializes a #graphene_vec3_t using the given values.

interpolate
void interpolate(graphene.vec3.Vec3 v2, double factor, graphene.vec3.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(graphene.vec3.Vec3 b, graphene.vec3.Vec3 res)

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

min
void min(graphene.vec3.Vec3 b, graphene.vec3.Vec3 res)

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

multiply
void multiply(graphene.vec3.Vec3 b, graphene.vec3.Vec3 res)

Multiplies each component of the two given vectors.

near
bool near(graphene.vec3.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(graphene.vec3.Vec3 res)

Negates the given #graphene_vec3_t.

normalize
void normalize(graphene.vec3.Vec3 res)

Normalizes the given #graphene_vec3_t.

scale
void scale(float factor, graphene.vec3.Vec3 res)

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

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

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

Static functions

alloc
graphene.vec3.Vec3 alloc()

Allocates a new #graphene_vec3_t structure.

one
graphene.vec3.Vec3 one()

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

xAxis
graphene.vec3.Vec3 xAxis()

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

yAxis
graphene.vec3.Vec3 yAxis()

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

zAxis
graphene.vec3.Vec3 zAxis()

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

zero
graphene.vec3.Vec3 zero()

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

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.