Quaternion

class Quaternion(pointer: <Error class: unknown class><<Error class: unknown class>>)

A quaternion.

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

Skipped during bindings generation

  • parameter angle: angle: Out parameter is not supported

  • parameter deg_x: deg_x: Out parameter is not supported

  • parameter rad_x: rad_x: Out parameter is not supported

  • field x: Record field x is private

  • field y: Record field y is private

  • field z: Record field z is private

  • field w: Record field w is private

Since

1.0

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val grapheneQuaternionPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun add(b: Quaternion, res: Quaternion)

Adds two #graphene_quaternion_t @a and @b.

Link copied to clipboard

Computes the dot product of two #graphene_quaternion_t.

Link copied to clipboard

Checks whether the given quaternions are equal.

Link copied to clipboard
fun free()

Releases the resources allocated by graphene_quaternion_alloc().

Link copied to clipboard
fun init(x: Float, y: Float, z: Float, w: Float): Quaternion

Initializes a #graphene_quaternion_t using the given four values.

Link copied to clipboard
fun initFromAngles(degX: Float, degY: Float, degZ: Float): Quaternion

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

Link copied to clipboard

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

Link copied to clipboard

Initializes a #graphene_quaternion_t using the given #graphene_euler_t.

Link copied to clipboard

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

Link copied to clipboard

Initializes a #graphene_quaternion_t with the values from @src.

Link copied to clipboard
fun initFromRadians(radX: Float, radY: Float, radZ: Float): Quaternion

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

Link copied to clipboard

Initializes a #graphene_quaternion_t with the values from @src.

Link copied to clipboard

Initializes a #graphene_quaternion_t using the identity transformation.

Link copied to clipboard
fun invert(res: Quaternion)

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

Link copied to clipboard

Multiplies two #graphene_quaternion_t @a and @b.

Link copied to clipboard

Normalizes a #graphene_quaternion_t.

Link copied to clipboard
fun scale(factor: Float, res: Quaternion)

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

Link copied to clipboard
fun slerp(b: Quaternion, factor: Float, res: Quaternion)

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

Link copied to clipboard

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

Link copied to clipboard
fun toVec4(res: Vec4)

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