Top | ![]() |
![]() |
![]() |
![]() |
graphene_ray_t * | graphene_ray_alloc () |
void | graphene_ray_free () |
graphene_ray_t * | graphene_ray_init () |
graphene_ray_t * | graphene_ray_init_from_ray () |
graphene_ray_t * | graphene_ray_init_from_vec3 () |
void | graphene_ray_get_origin () |
void | graphene_ray_get_direction () |
void | graphene_ray_get_position_at () |
float | graphene_ray_get_distance_to_point () |
float | graphene_ray_get_distance_to_plane () |
void | graphene_ray_get_closest_point_to_point () |
bool | graphene_ray_equal () |
graphene_ray_t is a structure representing a ray emitted by an origin, identified by a point in 3D space, in a given direction, identified by a vector with 3 components.
graphene_ray_t *
graphene_ray_alloc (void
);
Allocates a new graphene_ray_t structure.
The contents of the returned structure are undefined.
[constructor]
the newly allocated graphene_ray_t.
Use graphene_ray_free()
to free the resources allocated by
this function.
[transfer full]
Since: 1.4
void
graphene_ray_free (graphene_ray_t *r
);
Frees the resources allocated by graphene_ray_alloc()
.
Since: 1.4
graphene_ray_t * graphene_ray_init (graphene_ray_t *r
,const graphene_point3d_t *origin
,const graphene_vec3_t *direction
);
Initializes the given graphene_ray_t using the given origin
and direction
values.
r |
the graphene_ray_t to initialize |
|
origin |
the origin of the ray. |
[nullable] |
direction |
the direction vector. |
[nullable] |
Since: 1.4
graphene_ray_t * graphene_ray_init_from_ray (graphene_ray_t *r
,const graphene_ray_t *src
);
Initializes the given graphene_ray_t using the origin and direction values of another graphene_ray_t.
Since: 1.4
graphene_ray_t * graphene_ray_init_from_vec3 (graphene_ray_t *r
,const graphene_vec3_t *origin
,const graphene_vec3_t *direction
);
Initializes the given graphene_ray_t using the given vectors.
Since: 1.4
void graphene_ray_get_origin (const graphene_ray_t *r
,graphene_point3d_t *origin
);
Retrieves the origin of the given graphene_ray_t.
Since: 1.4
void graphene_ray_get_direction (const graphene_ray_t *r
,graphene_vec3_t *direction
);
Retrieves the direction of the given graphene_ray_t.
Since: 1.4
void graphene_ray_get_position_at (const graphene_ray_t *r
,float t
,graphene_point3d_t *position
);
Retrieves the coordinates of a point at the distance t
along the
given graphene_ray_t.
r |
||
t |
the distance along the ray |
|
position |
return location for the position. |
[out caller-allocates] |
Since: 1.4
float graphene_ray_get_distance_to_point (const graphene_ray_t *r
,const graphene_point3d_t *p
);
Computes the distance from the origin of the given ray to the given point.
Since: 1.4
float graphene_ray_get_distance_to_plane (const graphene_ray_t *r
,const graphene_plane_t *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
.
Since: 1.4
void graphene_ray_get_closest_point_to_point (const graphene_ray_t *r
,const graphene_point3d_t *p
,graphene_point3d_t *res
);
Computes the point on the given graphene_ray_t that is closest to the
given point p
.
Since: 1.4
bool graphene_ray_equal (const graphene_ray_t *a
,const graphene_ray_t *b
);
Checks whether the two given graphene_ray_t are equal.
Since: 1.4
typedef struct { } graphene_ray_t;
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.
Since: 1.4