Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GrapheneRayLayout

[13:14] static extends: object

Generated struct layout helper for GIR record Ray.

Methods

  • layout ()

    Returns the Panama struct layout for Ray.

class: GrapheneRay

[30:7] extends: object

A ray emitted from an origin in a given direction. The contents of the graphene_ray_t structure are private, and should not be modified directly.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GrapheneRay (Handle = null)

    Allocates a new #graphene_ray_t structure. The contents of the returned structure are undefined.

    • @p Handle is an optional native handle or wrapper whose handle to adopt; when the native constructor is called.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • equal (object b)

    Checks whether the two given #graphene_ray_t are equal.

    • @p b is a #graphene_ray_t.
    • @r true if the given rays are equal.
  • free ()

    Frees the resources allocated by graphene_ray_alloc().

    • @r None.
  • get_closest_point_to_point (object p)

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

    • @p p is a #graphene_point3d_t.
    • @p res is return location for the closest point3d.
    • @r None.
  • get_direction ()

    Retrieves the direction of the given #graphene_ray_t.

    • @p direction is return location for the direction.
    • @r None.
  • get_distance_to_plane (object p)

    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.

    • @p p is a #graphene_plane_t.
    • @r the distance of the origin of the ray from the plane.
  • get_distance_to_point (object p)

    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.

    • @p p is a #graphene_point3d_t.
    • @r the distance of the point.
  • get_origin ()

    Retrieves the origin of the given #graphene_ray_t.

    • @p origin is return location for the origin.
    • @r None.
  • get_position_at (double t)

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

    • @p t is the distance along the ray.
    • @p position is return location for the position.
    • @r None.
  • init (object origin, object direction)

    Initializes the given #graphene_ray_t using the given @origin and

    • @direction values.
    • @p origin is the origin of the ray.
    • @p direction is the direction vector.
    • @r the initialized ray.
  • init_from_ray (object src)

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

    • @p src is a #graphene_ray_t.
    • @r the initialized ray.
  • init_from_vec3 (object origin, object direction)

    Initializes the given #graphene_ray_t using the given vectors.

    • @p origin is a #graphene_vec3_t.
    • @p direction is a #graphene_vec3_t.
    • @r the initialized ray.
  • intersect_box (object b)

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

    • @b. ``
    • @p b is a #graphene_box_t.
    • @p t_out is the distance of the point on the ray that intersects the box.
    • @r the type of intersection.
  • intersect_sphere (object s)

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

    • @s. ``
    • @p s is a #graphene_sphere_t.
    • @p t_out is the distance of the point on the ray that intersects the sphere.
    • @r the type of intersection.
  • intersect_triangle (object t)

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

    • @p t is a #graphene_triangle_t.
    • @p t_out is the distance of the point on the ray that intersects the triangle.
    • @r the type of intersection.
  • intersects_box (object b)

    Checks whether the given #graphene_ray_t @r intersects the given #graphene_box_t @b. See also: graphene_ray_intersect_box()

    • @p b is a #graphene_box_t.
    • @r true if the ray intersects the box.
  • intersects_sphere (object s)

    Checks if the given #graphene_ray_t @r intersects the given #graphene_sphere_t @s. See also: graphene_ray_intersect_sphere()

    • @p s is a #graphene_sphere_t.
    • @r true if the ray intersects the sphere.
  • intersects_triangle (object t)

    Checks whether the given #graphene_ray_t @r intersects the given #graphene_triangle_t @b. See also: graphene_ray_intersect_triangle()

    • @p t is a #graphene_triangle_t.
    • @r true if the ray intersects the triangle.