package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.graphene/Ocgtk_graphene/Graphene/Wrappers/Quaternion/index.html

Module Wrappers.Quaternion

type t = [ `quaternion ] Gobject.obj
val alloc : unit -> t

Create a new Quaternion

val to_vec4 : t -> [ `vec4 ] Gobject.obj

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

val to_radians : t -> float * float * float

Converts a #graphene_quaternion_t to its corresponding rotations on the Euler angles(http://en.wikipedia.org/wiki/Euler_angles) on each axis.

val to_matrix : t -> [ `matrix ] Gobject.obj

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

val to_angles : t -> float * float * float

Converts a #graphene_quaternion_t to its corresponding rotations on the Euler angles(http://en.wikipedia.org/wiki/Euler_angles) on each axis.

val to_angle_vec3 : t -> float * [ `vec3 ] Gobject.obj

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

val slerp : t -> t -> float -> t

Interpolates between the two given quaternions using a spherical linear interpolation, or SLERP(http://en.wikipedia.org/wiki/Slerp), using the given interpolation @factor.

val scale : t -> float -> t

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

val normalize : t -> t

Normalizes a #graphene_quaternion_t.

val multiply : t -> t -> t

Multiplies two #graphene_quaternion_t @a and @b.

val invert : t -> t

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

val init_identity : t -> t

Initializes a #graphene_quaternion_t using the identity transformation.

val init_from_vec4 : t -> [ `vec4 ] Gobject.obj -> t

Initializes a #graphene_quaternion_t with the values from @src.

val init_from_radians : t -> float -> float -> float -> t

Initializes a #graphene_quaternion_t using the values of the Euler angles(http://en.wikipedia.org/wiki/Euler_angles) on each axis.

See also: graphene_quaternion_init_from_euler()

val init_from_quaternion : t -> t -> t

Initializes a #graphene_quaternion_t with the values from @src.

val init_from_matrix : t -> [ `matrix ] Gobject.obj -> t

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

val init_from_euler : t -> [ `euler ] Gobject.obj -> t

Initializes a #graphene_quaternion_t using the given #graphene_euler_t.

val init_from_angles : t -> float -> float -> float -> t

Initializes a #graphene_quaternion_t using the values of the Euler angles(http://en.wikipedia.org/wiki/Euler_angles) on each axis.

See also: graphene_quaternion_init_from_euler()

val init_from_angle_vec3 : t -> float -> [ `vec3 ] Gobject.obj -> t

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

val init : t -> float -> float -> float -> float -> t

Initializes a #graphene_quaternion_t using the given four values.

val equal : t -> t -> bool

Checks whether the given quaternions are equal.

val dot : t -> t -> float

Computes the dot product of two #graphene_quaternion_t.

val add : t -> t -> t

Adds two #graphene_quaternion_t @a and @b.