Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
graphene-plane.h
Go to the documentation of this file.
1/* graphene-plane.h: A plane in 3D space
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_plane_t:
39 *
40 * A 2D plane that extends infinitely in a 3D volume.
41 *
42 * The contents of the `graphene_plane_t` are private, and should not be
43 * modified directly.
44 *
45 * Since: 1.2
46 */
48{
49 /*< private >*/
51 GRAPHENE_PRIVATE_FIELD (float, constant);
52};
53
58
61 const graphene_vec3_t *normal,
62 float constant);
65 const graphene_vec4_t *src);
68 const graphene_plane_t *src);
71 const graphene_vec3_t *normal,
72 const graphene_point3d_t *point);
75 const graphene_point3d_t *a,
76 const graphene_point3d_t *b,
77 const graphene_point3d_t *c);
78
81 graphene_plane_t *res);
84 graphene_plane_t *res);
87 const graphene_plane_t *b);
90 const graphene_point3d_t *point);
91
94 graphene_vec3_t *normal);
97
100 const graphene_matrix_t *matrix,
101 const graphene_matrix_t *normal_matrix,
102 graphene_plane_t *res);
103
#define GRAPHENE_END_DECLS
#define GRAPHENE_BEGIN_DECLS
GRAPHENE_AVAILABLE_IN_1_2 float graphene_plane_distance(const graphene_plane_t *p, const graphene_point3d_t *point)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_plane_free(graphene_plane_t *p)
GRAPHENE_AVAILABLE_IN_1_2 bool graphene_plane_equal(const graphene_plane_t *a, const graphene_plane_t *b)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_plane_negate(const graphene_plane_t *p, graphene_plane_t *res)
GRAPHENE_AVAILABLE_IN_1_2 graphene_plane_t * graphene_plane_init_from_plane(graphene_plane_t *p, const graphene_plane_t *src)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_plane_get_normal(const graphene_plane_t *p, graphene_vec3_t *normal)
GRAPHENE_AVAILABLE_IN_1_2 graphene_plane_t * graphene_plane_init(graphene_plane_t *p, const graphene_vec3_t *normal, float constant)
GRAPHENE_AVAILABLE_IN_1_10 void graphene_plane_transform(const graphene_plane_t *p, const graphene_matrix_t *matrix, const graphene_matrix_t *normal_matrix, graphene_plane_t *res)
GRAPHENE_AVAILABLE_IN_1_2 graphene_plane_t * graphene_plane_init_from_vec4(graphene_plane_t *p, const graphene_vec4_t *src)
GRAPHENE_AVAILABLE_IN_1_2 float graphene_plane_get_constant(const graphene_plane_t *p)
GRAPHENE_AVAILABLE_IN_1_2 graphene_plane_t * graphene_plane_init_from_point(graphene_plane_t *p, const graphene_vec3_t *normal, const graphene_point3d_t *point)
GRAPHENE_AVAILABLE_IN_1_2 graphene_plane_t * graphene_plane_alloc(void)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_plane_normalize(const graphene_plane_t *p, graphene_plane_t *res)
GRAPHENE_AVAILABLE_IN_1_2 graphene_plane_t * graphene_plane_init_from_points(graphene_plane_t *p, const graphene_point3d_t *a, const graphene_point3d_t *b, const graphene_point3d_t *c)
#define GRAPHENE_AVAILABLE_IN_1_2
#define GRAPHENE_AVAILABLE_IN_1_10
GRAPHENE_PRIVATE_FIELD(graphene_vec3_t, normal)
GRAPHENE_PRIVATE_FIELD(float, constant)