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