graphene.vec3

Module for [Vec3] class

class Vec3

Types 1

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
void * _cPtr(Flag!"Dup" dup = No.Dup) nothrow
GType _getGType() static nothrow
GType _gType() @property nothrow
Vec3 self() nothrowReturns `this`, for use in `with` statements.
graphene.vec3.Vec3 alloc() static nothrowAllocates a new #graphene_vec3_t structure.
void add(graphene.vec3.Vec3 b, out graphene.vec3.Vec3 res) nothrowAdds each component of the two given vectors.
void cross(graphene.vec3.Vec3 b, out graphene.vec3.Vec3 res) nothrowComputes the cross product of the two given vectors.
void divide(graphene.vec3.Vec3 b, out graphene.vec3.Vec3 res) nothrowDivides 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) nothrowComputes the dot product of the two given vectors.
bool equal(graphene.vec3.Vec3 v2) nothrowChecks whether the two given #graphene_vec3_t are equal.
float getX() nothrowRetrieves the first component of the given vector `v`. Returns: the value of the first component of the vector
void getXy(out graphene.vec2.Vec2 res) nothrowCreates a #graphene_vec2_t that contains the first and second components of the given #graphene_vec3_t.
void getXy0(out graphene.vec3.Vec3 res) nothrowCreates a #graphene_vec3_t that contains the first two components of the given #graphene_vec3_t, and the third component set to 0.
void getXyz0(out graphene.vec4.Vec4 res) nothrowConverts a #graphene_vec3_t in a #graphene_vec4_t using 0.0 as the value for the fourth component of the resulting vector.
void getXyz1(out graphene.vec4.Vec4 res) nothrowConverts a #graphene_vec3_t in a #graphene_vec4_t using 1.0 as the value for the fourth component of the resulting vector.
void getXyzw(float w, out graphene.vec4.Vec4 res) nothrowConverts a #graphene_vec3_t in a #graphene_vec4_t using `w` as the value of the fourth component of the resulting vector.
float getY() nothrowRetrieves the second component of the given vector `v`. Returns: the value of the second component of the vector
float getZ() nothrowRetrieves the third component of the given vector `v`. Returns: the value of the third component of the vector
graphene.vec3.Vec3 init_(float x, float y, float z) nothrowInitializes a #graphene_vec3_t using the given values.
graphene.vec3.Vec3 initFromFloat(float[] src) nothrowInitializes a #graphene_vec3_t with the values from an array.
graphene.vec3.Vec3 initFromVec3(graphene.vec3.Vec3 src) nothrowInitializes a #graphene_vec3_t with the values of another #graphene_vec3_t.
void interpolate(graphene.vec3.Vec3 v2, double factor, out graphene.vec3.Vec3 res) nothrowLinearly interpolates v1 and v2 using the given factor.
float length() nothrowRetrieves the length of the given vector `v`. Returns: the value of the length of the vector
void max(graphene.vec3.Vec3 b, out graphene.vec3.Vec3 res) nothrowCompares 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) nothrowCompares 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) nothrowMultiplies each component of the two given vectors.
bool near(graphene.vec3.Vec3 v2, float epsilon) nothrowCompares the two given #graphene_vec3_t vectors and checks whether their values are within the given epsilon.
void negate(out graphene.vec3.Vec3 res) nothrowNegates the given #graphene_vec3_t.
void normalize(out graphene.vec3.Vec3 res) nothrowNormalizes the given #graphene_vec3_t.
void scale(float factor, out graphene.vec3.Vec3 res) nothrowMultiplies all components of the given vector with the given scalar factor.
void subtract(graphene.vec3.Vec3 b, out graphene.vec3.Vec3 res) nothrowSubtracts 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) nothrowCopies the components of a #graphene_vec3_t into the given array.
graphene.vec3.Vec3 one() static nothrowProvides a constant pointer to a vector with three components, all sets to 1. Returns: a constant vector
graphene.vec3.Vec3 xAxis() static nothrowProvides a constant pointer to a vector with three components with values set to (1, 0, 0). Returns: a constant vector
graphene.vec3.Vec3 yAxis() static nothrowProvides a constant pointer to a vector with three components with values set to (0, 1, 0). Returns: a constant vector
graphene.vec3.Vec3 zAxis() static nothrowProvides a constant pointer to a vector with three components with values set to (0, 0, 1). Returns: a constant vector
graphene.vec3.Vec3 zero() static nothrowProvides a constant pointer to a vector with three components, all sets to 0. Returns: a constant vector
Constructors
this()Create a `vec3.Vec3` boxed type.
this(void * ptr, Flag!"Take" take)