Quaternion

A quaternion.

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

Constructors

this
this(graphene_quaternion_t* graphene_quaternion, bool ownedRef)

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

this
this()

Allocates a new #graphene_quaternion_t.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

add
void add(Quaternion b, Quaternion res)

Adds two #graphene_quaternion_t @a and @b.

dot
float dot(Quaternion b)

Computes the dot product of two #graphene_quaternion_t.

equal
bool equal(Quaternion b)

Checks whether the given quaternions are equal.

free
void free()

Releases the resources allocated by graphene_quaternion_alloc().

getQuaternionStruct
graphene_quaternion_t* getQuaternionStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

init
Quaternion init(float x, float y, float z, float w)

Initializes a #graphene_quaternion_t using the given four values.

initFromAngleVec3
Quaternion initFromAngleVec3(float angle, Vec3 axis)

Initializes a #graphene_quaternion_t using an @angle on a specific @axis.

initFromAngles
Quaternion initFromAngles(float degX, float degY, float degZ)

Initializes a #graphene_quaternion_t using the values of the Euler angles on each axis.

initFromEuler
Quaternion initFromEuler(Euler e)

Initializes a #graphene_quaternion_t using the given #graphene_euler_t.

initFromMatrix
Quaternion initFromMatrix(Matrix m)

Initializes a #graphene_quaternion_t using the rotation components of a transformation matrix.

initFromQuaternion
Quaternion initFromQuaternion(Quaternion src)

Initializes a #graphene_quaternion_t with the values from @src.

initFromRadians
Quaternion initFromRadians(float radX, float radY, float radZ)

Initializes a #graphene_quaternion_t using the values of the Euler angles on each axis.

initFromVec4
Quaternion initFromVec4(Vec4 src)

Initializes a #graphene_quaternion_t with the values from @src.

initIdentity
Quaternion initIdentity()

Initializes a #graphene_quaternion_t using the identity transformation.

invert
void invert(Quaternion res)

Inverts a #graphene_quaternion_t, and returns the conjugate quaternion of @q.

multiply
void multiply(Quaternion b, Quaternion res)

Multiplies two #graphene_quaternion_t @a and @b.

normalize
void normalize(Quaternion res)

Normalizes a #graphene_quaternion_t.

scale
void scale(float factor, Quaternion res)

Scales all the elements of a #graphene_quaternion_t @q using the given scalar factor.

slerp
void slerp(Quaternion b, float factor, Quaternion res)

Interpolates between the two given quaternions using a spherical linear interpolation, or SLERP, using the given interpolation @factor.

toAngleVec3
void toAngleVec3(float angle, Vec3 axis)

Converts a quaternion into an @angle, @axis pair.

toAngles
void toAngles(float degX, float degY, float degZ)

Converts a #graphene_quaternion_t to its corresponding rotations on the Euler angles on each axis.

toMatrix
void toMatrix(Matrix m)

Converts a quaternion into a transformation matrix expressing the rotation defined by the #graphene_quaternion_t.

toRadians
void toRadians(float radX, float radY, float radZ)

Converts a #graphene_quaternion_t to its corresponding rotations on the Euler angles on each axis.

toVec4
void toVec4(Vec4 res)

Copies the components of a #graphene_quaternion_t into a #graphene_vec4_t.

Static functions

getType
GType getType()

Variables

graphene_quaternion
graphene_quaternion_t* graphene_quaternion;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta