Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
graphene-triangle.h
Go to the documentation of this file.
1/* graphene-triangle.h: A triangle
2 *
3 * SPDX-License-Identifier: MIT
4 *
5 * Copyright 2014 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_triangle_t:
39 *
40 * A triangle.
41 *
42 * Since: 1.2
43 */
51
56
59 const graphene_point3d_t *a,
60 const graphene_point3d_t *b,
61 const graphene_point3d_t *c);
64 const graphene_vec3_t *a,
65 const graphene_vec3_t *b,
66 const graphene_vec3_t *c);
69 const float *a,
70 const float *b,
71 const float *c);
89 graphene_vec3_t *res);
92 graphene_plane_t *res);
95 graphene_box_t *res);
98 const graphene_point3d_t *p,
99 graphene_vec2_t *res);
102 const graphene_point3d_t *p,
103 const graphene_vec2_t *uv_a,
104 const graphene_vec2_t *uv_b,
105 const graphene_vec2_t *uv_c,
106 graphene_vec2_t *res);
107
110 const graphene_point3d_t *p);
113 const graphene_triangle_t *b);
114
#define GRAPHENE_END_DECLS
#define GRAPHENE_BEGIN_DECLS
GRAPHENE_AVAILABLE_IN_1_2 float graphene_triangle_get_area(const graphene_triangle_t *t)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_triangle_get_normal(const graphene_triangle_t *t, graphene_vec3_t *res)
GRAPHENE_AVAILABLE_IN_1_10 graphene_triangle_t * graphene_triangle_init_from_float(graphene_triangle_t *t, const float *a, const float *b, const float *c)
GRAPHENE_AVAILABLE_IN_1_2 graphene_triangle_t * graphene_triangle_init_from_vec3(graphene_triangle_t *t, const graphene_vec3_t *a, const graphene_vec3_t *b, const graphene_vec3_t *c)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_triangle_get_vertices(const graphene_triangle_t *t, graphene_vec3_t *a, graphene_vec3_t *b, graphene_vec3_t *c)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_triangle_get_points(const graphene_triangle_t *t, graphene_point3d_t *a, graphene_point3d_t *b, graphene_point3d_t *c)
GRAPHENE_AVAILABLE_IN_1_2 bool graphene_triangle_equal(const graphene_triangle_t *a, const graphene_triangle_t *b)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_triangle_get_midpoint(const graphene_triangle_t *t, graphene_point3d_t *res)
GRAPHENE_AVAILABLE_IN_1_2 graphene_triangle_t * graphene_triangle_init_from_point3d(graphene_triangle_t *t, const graphene_point3d_t *a, const graphene_point3d_t *b, const graphene_point3d_t *c)
GRAPHENE_AVAILABLE_IN_1_10 bool graphene_triangle_get_uv(const graphene_triangle_t *t, const graphene_point3d_t *p, const graphene_vec2_t *uv_a, const graphene_vec2_t *uv_b, const graphene_vec2_t *uv_c, graphene_vec2_t *res)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_triangle_free(graphene_triangle_t *t)
GRAPHENE_AVAILABLE_IN_1_2 bool graphene_triangle_contains_point(const graphene_triangle_t *t, const graphene_point3d_t *p)
GRAPHENE_AVAILABLE_IN_1_2 graphene_triangle_t * graphene_triangle_alloc(void)
GRAPHENE_AVAILABLE_IN_1_2 bool graphene_triangle_get_barycoords(const graphene_triangle_t *t, const graphene_point3d_t *p, graphene_vec2_t *res)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_triangle_get_bounding_box(const graphene_triangle_t *t, graphene_box_t *res)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_triangle_get_plane(const graphene_triangle_t *t, graphene_plane_t *res)
#define GRAPHENE_AVAILABLE_IN_1_2
#define GRAPHENE_AVAILABLE_IN_1_10
GRAPHENE_PRIVATE_FIELD(graphene_vec3_t, c)
GRAPHENE_PRIVATE_FIELD(graphene_vec3_t, b)
GRAPHENE_PRIVATE_FIELD(graphene_vec3_t, a)