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/Vec4/index.html

Module Wrappers.Vec4

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

Create a new Vec4

val to_float : t -> float array

Stores the components of the given #graphene_vec4_t into an array of floating point values.

val subtract : t -> t -> t

Subtracts 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.

val scale : t -> float -> t

Multiplies all components of the given vector with the given scalar @factor.

val normalize : t -> t

Normalizes the given #graphene_vec4_t.

val negate : t -> t

Negates the given #graphene_vec4_t.

val near : t -> t -> float -> bool

Compares the two given #graphene_vec4_t vectors and checks whether their values are within the given @epsilon.

val multiply : t -> t -> t

Multiplies each component of the two given vectors.

val min : t -> t -> t

Compares each component of the two given vectors and creates a vector that contains the minimum values.

val max : t -> t -> t

Compares each component of the two given vectors and creates a vector that contains the maximum values.

val length : t -> float

Computes the length of the given #graphene_vec4_t.

val interpolate : t -> t -> float -> t

Linearly interpolates @v1 and @v2 using the given @factor.

val init_from_vec4 : t -> t -> t

Initializes a #graphene_vec4_t using the components of another #graphene_vec4_t.

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

Initializes a #graphene_vec4_t using the components of a #graphene_vec3_t and the value of @w.

val init_from_vec2 : t -> [ `vec2 ] Gobject.obj -> float -> float -> t

Initializes a #graphene_vec4_t using the components of a #graphene_vec2_t and the values of @z and @w.

val init_from_float : t -> float array -> t

Initializes a #graphene_vec4_t with the values inside the given array.

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

Initializes a #graphene_vec4_t using the given values.

This function can be called multiple times.

val get_z : t -> float

Retrieves the value of the third component of the given #graphene_vec4_t.

val get_y : t -> float

Retrieves the value of the second component of the given #graphene_vec4_t.

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

Creates a #graphene_vec3_t that contains the first three components of the given #graphene_vec4_t.

val get_xy : t -> [ `vec2 ] Gobject.obj

Creates a #graphene_vec2_t that contains the first two components of the given #graphene_vec4_t.

val get_x : t -> float

Retrieves the value of the first component of the given #graphene_vec4_t.

val get_w : t -> float

Retrieves the value of the fourth component of the given #graphene_vec4_t.

val equal : t -> t -> bool

Checks whether the two given #graphene_vec4_t are equal.

val dot : t -> t -> float

Computes the dot product of the two given vectors.

val divide : t -> t -> t

Divides each component of the first operand @a by the corresponding component of the second operand @b, and places the results into the vector @res.

val add : t -> t -> t

Adds each component of the two given vectors.