About all my projects
NO_TITLE

NO_TITLE

Gnome::Graphene::N-Ray

Description

A ray emitted from an origin in a given direction.

The contents of the Gnome::Graphene::N-Ray structure are private, and should not be modified directly.

Class initialization

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object :$native-object! )

alloc

Allocates a new Gnome::Graphene::N-Ray structure.

The contents of the returned structure are undefined.

method alloc ( --> Gnome::Graphene::Ray \)

Methods

equal

Checks whether the two given Gnome::Graphene::N-Ray are equal.

method equal ( N-Object $b --> gboolean )
  • $b; a Gnome::Graphene::N-Ray

Return value; true if the given rays are equal.

free

Frees the resources allocated by .alloc().

method free ( )

get-closest-point-to-point

Computes the point on the given Gnome::Graphene::N-Ray that is closest to the given point $p.

method get-closest-point-to-point ( N-Object $p, N-Object $res )
  • $p; a graphene_point3d_t

  • $res; return location for the closest point3d

get-direction

Retrieves the direction of the given Gnome::Graphene::N-Ray.

method get-direction ( N-Object $direction )
  • $direction; return location for the direction

get-distance-to-plane

Computes the distance of the origin of the given Gnome::Graphene::N-Ray from the given plane.

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

method get-distance-to-plane ( N-Object $p --> Num )
  • $p; a Gnome::Graphene::N-Plane

Return value; the distance of the origin of the ray from the plane.

get-distance-to-point

Computes the distance of the closest approach between the given Gnome::Graphene::N-Ray $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.

method get-distance-to-point ( N-Object $p --> Num )
  • $p; a graphene_point3d_t

Return value; the distance of the point.

get-origin

Retrieves the origin of the given Gnome::Graphene::N-Ray.

method get-origin ( N-Object $origin )
  • $origin; return location for the origin

get-position-at

Retrieves the coordinates of a point at the distance $t along the given Gnome::Graphene::N-Ray.

method get-position-at ( Num() $t, N-Object $position )
  • $t; the distance along the ray.

  • $position; return location for the position

init

Initializes the given Gnome::Graphene::N-Ray using the given $origin and $direction values.

method init ( N-Object $origin, N-Object $direction --> N-Object )
  • $origin; the origin of the ray

  • $direction; the direction vector

Return value; the initialized ray.

init-from-ray

Initializes the given Gnome::Graphene::N-Ray using the origin and direction values of another Gnome::Graphene::N-Ray.

method init-from-ray ( N-Object $src --> N-Object )
  • $src; a Gnome::Graphene::N-Ray

Return value; the initialized ray.

init-from-vec3

Initializes the given Gnome::Graphene::N-Ray using the given vectors.

method init-from-vec3 ( N-Object $origin, N-Object $direction --> N-Object )
  • $origin; a graphene_vec3_t

  • $direction; a graphene_vec3_t

Return value; the initialized ray.

intersect-box

Intersects the given Gnome::Graphene::N-Ray $r with the given Gnome::Graphene::N-Box $b.

method intersect-box ( N-Object $b, Num() $t-out --> graphene_ray_intersection_kind_t )
  • $b; a Gnome::Graphene::N-Box

  • $t-out; (transfer ownership: full) the distance of the point on the ray that intersects the box.

Return value; the type of intersection.

intersect-sphere

Intersects the given Gnome::Graphene::N-Ray $r with the given Gnome::Graphene::N-Sphere $s.

method intersect-sphere ( N-Object $s, Num() $t-out --> graphene_ray_intersection_kind_t )
  • $s; a Gnome::Graphene::N-Sphere

  • $t-out; (transfer ownership: full) the distance of the point on the ray that intersects the sphere.

Return value; the type of intersection.

intersect-triangle

Intersects the given Gnome::Graphene::N-Ray $r with the given Gnome::Graphene::N-Triangle $t.

method intersect-triangle ( N-Object $t, Num() $t-out --> graphene_ray_intersection_kind_t )
  • $t; a Gnome::Graphene::N-Triangle

  • $t-out; (transfer ownership: full) the distance of the point on the ray that intersects the triangle.

Return value; the type of intersection.

intersects-box

Checks whether the given Gnome::Graphene::N-Ray $r intersects the given Gnome::Graphene::N-Box $b.

See also: .intersect-box()

method intersects-box ( N-Object $b --> gboolean )
  • $b; a Gnome::Graphene::N-Box

Return value; true if the ray intersects the box.

intersects-sphere

Checks if the given Gnome::Graphene::N-Ray $r intersects the given Gnome::Graphene::N-Sphere $s.

See also: .intersect-sphere()

method intersects-sphere ( N-Object $s --> gboolean )
  • $s; a Gnome::Graphene::N-Sphere

Return value; true if the ray intersects the sphere.

intersects-triangle

Checks whether the given Gnome::Graphene::N-Ray $r intersects the given Gnome::Graphene::N-Triangle $b.

See also: .intersect-triangle()

method intersects-triangle ( N-Object $t --> gboolean )
  • $t; a Gnome::Graphene::N-Triangle

Return value; true if the ray intersects the triangle.