package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Ray

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

Create a new Ray

val intersects_triangle : t -> [ `triangle ] Gobject.obj -> bool

Checks whether the given #graphene_ray_t @r intersects the given #graphene_triangle_t @b.

See also: graphene_ray_intersect_triangle()

val intersects_sphere : t -> [ `sphere ] Gobject.obj -> bool

Checks if the given #graphene_ray_t @r intersects the given #graphene_sphere_t @s.

See also: graphene_ray_intersect_sphere()

val intersects_box : t -> [ `box ] Gobject.obj -> bool

Checks whether the given #graphene_ray_t @r intersects the given #graphene_box_t @b.

See also: graphene_ray_intersect_box()

val intersect_triangle : t -> [ `triangle ] Gobject.obj -> Graphene_enums.rayintersectionkind * float

Intersects the given #graphene_ray_t @r with the given #graphene_triangle_t @t.

val intersect_sphere : t -> [ `sphere ] Gobject.obj -> Graphene_enums.rayintersectionkind * float

Intersects the given #graphene_ray_t @r with the given #graphene_sphere_t @s.

val intersect_box : t -> [ `box ] Gobject.obj -> Graphene_enums.rayintersectionkind * float

Intersects the given #graphene_ray_t @r with the given #graphene_box_t @b.

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

Initializes the given #graphene_ray_t using the given vectors.

val init_from_ray : t -> t -> t

Initializes the given #graphene_ray_t using the origin and direction values of another #graphene_ray_t.

val init : t -> [ `point3_d ] Gobject.obj option -> [ `vec3 ] Gobject.obj option -> t

Initializes the given #graphene_ray_t using the given @origin and @direction values.

val get_position_at : t -> float -> [ `point3_d ] Gobject.obj

Retrieves the coordinates of a point at the distance @t along the given #graphene_ray_t.

val get_origin : t -> [ `point3_d ] Gobject.obj

Retrieves the origin of the given #graphene_ray_t.

val get_distance_to_point : t -> [ `point3_d ] Gobject.obj -> float

Computes the distance of the closest approach between the given #graphene_ray_t @r and the point @p.

The closest approach to a ray from a point is the distance between the point and the projection of the point on the ray itself.

val get_distance_to_plane : t -> [ `plane ] Gobject.obj -> float

Computes the distance of the origin of the given #graphene_ray_t from the given plane.

If the ray does not intersect the plane, this function returns `INFINITY`.

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

Retrieves the direction of the given #graphene_ray_t.

val get_closest_point_to_point : t -> [ `point3_d ] Gobject.obj -> [ `point3_d ] Gobject.obj

Computes the point on the given #graphene_ray_t that is closest to the given point @p.

val equal : t -> t -> bool

Checks whether the two given #graphene_ray_t are equal.