Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
graphene-ray.h
Go to the documentation of this file.
1/* graphene-ray.h: A ray emitted from an origin in a given direction
2 *
3 * SPDX-License-Identifier: MIT
4 *
5 * Copyright 2015 Emmanuele Bassi
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE.
24 */
25
26#pragma once
27
28#if !defined(GRAPHENE_H_INSIDE) && !defined(GRAPHENE_COMPILATION)
29#error "Only graphene.h can be included directly."
30#endif
31
32#include "graphene-types.h"
33#include "graphene-vec3.h"
34
36
37/**
38 * graphene_ray_t:
39 *
40 * A ray emitted from an origin in a given direction.
41 *
42 * The contents of the `graphene_ray_t` structure are private, and should not
43 * be modified directly.
44 *
45 * Since: 1.4
46 */
53
54/**
55 * graphene_ray_intersection_kind_t:
56 * @GRAPHENE_RAY_INTERSECTION_KIND_NONE: No intersection
57 * @GRAPHENE_RAY_INTERSECTION_KIND_ENTER: The ray is entering the intersected
58 * object
59 * @GRAPHENE_RAY_INTERSECTION_KIND_LEAVE: The ray is leaving the intersected
60 * object
61 *
62 * The type of intersection.
63 *
64 * Since: 1.10
65 */
71
76
79 const graphene_point3d_t *origin,
80 const graphene_vec3_t *direction);
83 const graphene_ray_t *src);
86 const graphene_vec3_t *origin,
87 const graphene_vec3_t *direction);
90 graphene_point3d_t *origin);
93 graphene_vec3_t *direction);
94
97 float t,
98 graphene_point3d_t *position);
101 const graphene_point3d_t *p);
104 const graphene_plane_t *p);
105
108 const graphene_ray_t *b);
109
112 const graphene_point3d_t *p,
113 graphene_point3d_t *res);
114
117 const graphene_sphere_t *s,
118 float *t_out);
121 const graphene_sphere_t *s);
124 const graphene_box_t *b,
125 float *t_out);
128 const graphene_box_t *b);
131 const graphene_triangle_t *t,
132 float *t_out);
135 const graphene_triangle_t *t);
136
#define GRAPHENE_END_DECLS
#define GRAPHENE_BEGIN_DECLS
GRAPHENE_AVAILABLE_IN_1_4 void graphene_ray_get_position_at(const graphene_ray_t *r, float t, graphene_point3d_t *position)
GRAPHENE_AVAILABLE_IN_1_10 graphene_ray_intersection_kind_t graphene_ray_intersect_sphere(const graphene_ray_t *r, const graphene_sphere_t *s, float *t_out)
GRAPHENE_AVAILABLE_IN_1_4 graphene_ray_t * graphene_ray_init(graphene_ray_t *r, const graphene_point3d_t *origin, const graphene_vec3_t *direction)
GRAPHENE_AVAILABLE_IN_1_4 void graphene_ray_get_closest_point_to_point(const graphene_ray_t *r, const graphene_point3d_t *p, graphene_point3d_t *res)
GRAPHENE_AVAILABLE_IN_1_4 graphene_ray_t * graphene_ray_alloc(void)
GRAPHENE_AVAILABLE_IN_1_10 graphene_ray_intersection_kind_t graphene_ray_intersect_triangle(const graphene_ray_t *r, const graphene_triangle_t *t, float *t_out)
GRAPHENE_AVAILABLE_IN_1_10 bool graphene_ray_intersects_triangle(const graphene_ray_t *r, const graphene_triangle_t *t)
GRAPHENE_AVAILABLE_IN_1_4 float graphene_ray_get_distance_to_point(const graphene_ray_t *r, const graphene_point3d_t *p)
GRAPHENE_AVAILABLE_IN_1_10 graphene_ray_intersection_kind_t graphene_ray_intersect_box(const graphene_ray_t *r, const graphene_box_t *b, float *t_out)
GRAPHENE_AVAILABLE_IN_1_4 float graphene_ray_get_distance_to_plane(const graphene_ray_t *r, const graphene_plane_t *p)
GRAPHENE_AVAILABLE_IN_1_4 graphene_ray_t * graphene_ray_init_from_ray(graphene_ray_t *r, const graphene_ray_t *src)
GRAPHENE_AVAILABLE_IN_1_4 bool graphene_ray_equal(const graphene_ray_t *a, const graphene_ray_t *b)
graphene_ray_intersection_kind_t
@ GRAPHENE_RAY_INTERSECTION_KIND_NONE
@ GRAPHENE_RAY_INTERSECTION_KIND_LEAVE
@ GRAPHENE_RAY_INTERSECTION_KIND_ENTER
GRAPHENE_AVAILABLE_IN_1_10 bool graphene_ray_intersects_sphere(const graphene_ray_t *r, const graphene_sphere_t *s)
GRAPHENE_AVAILABLE_IN_1_10 bool graphene_ray_intersects_box(const graphene_ray_t *r, const graphene_box_t *b)
GRAPHENE_AVAILABLE_IN_1_4 void graphene_ray_get_direction(const graphene_ray_t *r, graphene_vec3_t *direction)
GRAPHENE_AVAILABLE_IN_1_4 void graphene_ray_free(graphene_ray_t *r)
GRAPHENE_AVAILABLE_IN_1_4 void graphene_ray_get_origin(const graphene_ray_t *r, graphene_point3d_t *origin)
GRAPHENE_AVAILABLE_IN_1_4 graphene_ray_t * graphene_ray_init_from_vec3(graphene_ray_t *r, const graphene_vec3_t *origin, const graphene_vec3_t *direction)
#define GRAPHENE_AVAILABLE_IN_1_4
#define GRAPHENE_AVAILABLE_IN_1_10
CURL_EXTERN CURLMcode curl_socket_t s
Definition multi.h:318
GRAPHENE_PRIVATE_FIELD(graphene_vec3_t, direction)
GRAPHENE_PRIVATE_FIELD(graphene_vec3_t, origin)