graphene.vec4
Module for [Vec4] class
class Vec4
Types 1
classVec4 : gobject.boxed.Boxed
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.
Methods
graphene.vec4.Vec4 alloc()Allocates a new #graphenevec4t structure.void add(graphene.vec4.Vec4 b, out graphene.vec4.Vec4 res)Adds each component of the two given vectors.void divide(graphene.vec4.Vec4 b, out graphene.vec4.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.float dot(graphene.vec4.Vec4 b)Computes the dot product of the two given vectors.bool equal(graphene.vec4.Vec4 v2)Checks whether the two given #graphenevec4t are equal.float getW()Retrieves the value of the fourth component of the given #graphenevec4t. Returns: the value of the fourth componentfloat getX()Retrieves the value of the first component of the given #graphenevec4t. Returns: the value of the first componentvoid getXy(out graphene.vec2.Vec2 res)Creates a #graphenevec2t that contains the first two components of the given #graphenevec4t.void getXyz(out graphene.vec3.Vec3 res)Creates a #graphenevec3t that contains the first three components of the given #graphenevec4t.float getY()Retrieves the value of the second component of the given #graphenevec4t. Returns: the value of the second componentfloat getZ()Retrieves the value of the third component of the given #graphenevec4t. Returns: the value of the third componentgraphene.vec4.Vec4 init_(float x, float y, float z, float w)Initializes a #graphenevec4t using the given values.graphene.vec4.Vec4 initFromFloat(float[] src)Initializes a #graphenevec4t with the values inside the given array.graphene.vec4.Vec4 initFromVec2(graphene.vec2.Vec2 src, float z, float w)Initializes a #graphenevec4t using the components of a #graphenevec2t and the values of `z` and `w`.graphene.vec4.Vec4 initFromVec3(graphene.vec3.Vec3 src, float w)Initializes a #graphenevec4t using the components of a #graphenevec3t and the value of `w`.graphene.vec4.Vec4 initFromVec4(graphene.vec4.Vec4 src)Initializes a #graphenevec4t using the components of another #graphenevec4t.void interpolate(graphene.vec4.Vec4 v2, double factor, out graphene.vec4.Vec4 res)Linearly interpolates v1 and v2 using the given factor.float length()Computes the length of the given #graphenevec4t. Returns: the length of the vectorvoid max(graphene.vec4.Vec4 b, out graphene.vec4.Vec4 res)Compares each component of the two given vectors and creates a vector that contains the maximum values.void min(graphene.vec4.Vec4 b, out graphene.vec4.Vec4 res)Compares each component of the two given vectors and creates a vector that contains the minimum values.void multiply(graphene.vec4.Vec4 b, out graphene.vec4.Vec4 res)Multiplies each component of the two given vectors.bool near(graphene.vec4.Vec4 v2, float epsilon)Compares the two given #graphenevec4t vectors and checks whether their values are within the given epsilon.void negate(out graphene.vec4.Vec4 res)Negates the given #graphenevec4t.void normalize(out graphene.vec4.Vec4 res)Normalizes the given #graphenevec4t.void scale(float factor, out graphene.vec4.Vec4 res)Multiplies all components of the given vector with the given scalar factor.void subtract(graphene.vec4.Vec4 b, out graphene.vec4.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.void toFloat(ref float[] dest)Stores the components of the given #graphenevec4t into an array of floating point values.graphene.vec4.Vec4 one()Retrieves a pointer to a #graphenevec4t with all its components set to 1. Returns: a constant vectorgraphene.vec4.Vec4 wAxis()Retrieves a pointer to a #graphenevec4t with its components set to (0, 0, 0, 1). Returns: a constant vectorgraphene.vec4.Vec4 xAxis()Retrieves a pointer to a #graphenevec4t with its components set to (1, 0, 0, 0). Returns: a constant vectorgraphene.vec4.Vec4 yAxis()Retrieves a pointer to a #graphenevec4t with its components set to (0, 1, 0, 0). Returns: a constant vectorgraphene.vec4.Vec4 zAxis()Retrieves a pointer to a #graphenevec4t with its components set to (0, 0, 1, 0). Returns: a constant vectorgraphene.vec4.Vec4 zero()Retrieves a pointer to a #graphenevec4t with all its components set to 0. Returns: a constant vector