Quaternion
Object Hierarchy:
Description:
[ CCode ( cname = "graphene_quaternion_t" , copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "graphene_quaternion_get_type ()" ) ]
[ Version ( since = "1.0" ) ]
public struct Quaternion
[ Version ( since = "1.0" ) ]
public struct Quaternion
A quaternion.
The contents of the Quaternion structure are private and should never be accessed directly.
Namespace: Graphene
Package: graphene-gobject-1.0
Content:
Methods:
- public Quaternion add (Quaternion b)
Adds two Quaternion this and
b
. - public float dot (Quaternion b)
Computes the dot product of two Quaternion.
- public bool equal (Quaternion b)
Checks whether the given quaternions are equal.
- public unowned Quaternion? init (float x, float y, float z, float w)
Initializes a Quaternion using the given four values.
- public unowned Quaternion? init_from_angle_vec3 (float angle, Vec3 axis)
Initializes a Quaternion using an
angle
on a specificaxis
. - public unowned Quaternion? init_from_angles (float deg_x, float deg_y, float deg_z)
Initializes a Quaternion using the values of the Euler angles on each axis.
- public unowned Quaternion? init_from_euler (Euler e)
Initializes a Quaternion using the given Euler.
- public unowned Quaternion? init_from_matrix (Matrix m)
Initializes a Quaternion using the rotation components of a transformation matrix.
- public unowned Quaternion? init_from_quaternion (Quaternion src)
Initializes a Quaternion with the values from
src
. - public unowned Quaternion? init_from_radians (float rad_x, float rad_y, float rad_z)
Initializes a Quaternion using the values of the Euler angles on each axis.
- public unowned Quaternion? init_from_vec4 (Vec4 src)
Initializes a Quaternion with the values from
src
. - public unowned Quaternion? init_identity ()
Initializes a Quaternion using the identity transformation.
- public Quaternion invert ()
Inverts a Quaternion, and returns the conjugate quaternion of this.
- public Quaternion multiply (Quaternion b)
Multiplies two Quaternion this and
b
. - public Quaternion normalize ()
Normalizes a Quaternion.
- public Quaternion scale (float factor)
Scales all the elements of a Quaternion this using the given scalar factor.
- public Quaternion slerp (Quaternion b, float factor)
Interpolates between the two given quaternions using a spherical linear interpolation, or SLERP, using the given interpolation
factor
. - public void to_angle_vec3 (out float angle, out Vec3 axis)
Converts a quaternion into an
angle
,axis
pair. - public void to_angles (out float deg_x, out float deg_y, out float deg_z)
Converts a Quaternion to its corresponding rotations on the Euler angles on each axis.
- public Matrix to_matrix ()
Converts a quaternion into a transformation matrix expressing the rotation defined by the Quaternion.
- public void to_radians (out float rad_x, out float rad_y, out float rad_z)
Converts a Quaternion to its corresponding rotations on the Euler angles on each axis.
- public Vec4 to_vec4 ()
Copies the components of a Quaternion into a Vec4.