Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
graphene-matrix.h
Go to the documentation of this file.
1/* graphene-matrix.h: 4x4 matrix
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#include "graphene-types.h"
29
31
32/**
33 * graphene_matrix_t:
34 *
35 * A structure capable of holding a 4x4 matrix.
36 *
37 * The contents of the #graphene_matrix_t structure are private and
38 * should never be accessed directly.
39 */
45
50
55 const float *v);
58 const graphene_vec4_t *v0,
59 const graphene_vec4_t *v1,
60 const graphene_vec4_t *v2,
61 const graphene_vec4_t *v3);
64 const graphene_matrix_t *src);
67 float fovy,
68 float aspect,
69 float z_near,
70 float z_far);
73 float left,
74 float right,
75 float top,
76 float bottom,
77 float z_near,
78 float z_far);
81 const graphene_vec3_t *eye,
82 const graphene_vec3_t *center,
83 const graphene_vec3_t *up);
86 float left,
87 float right,
88 float bottom,
89 float top,
90 float z_near,
91 float z_far);
94 float x,
95 float y,
96 float z);
99 const graphene_point3d_t *p);
102 float angle,
103 const graphene_vec3_t *axis);
106 float x_skew,
107 float y_skew);
110 double xx,
111 double yx,
112 double xy,
113 double yy,
114 double x_0,
115 double y_0);
116
125
128 float *v);
131 double *xx,
132 double *yx,
133 double *xy,
134 double *yy,
135 double *x_0,
136 double *y_0);
137
138
141 unsigned int index_,
142 graphene_vec4_t *res);
145 unsigned int row,
146 unsigned int col);
147
150 const graphene_matrix_t *b,
151 graphene_matrix_t *res);
154
157 const graphene_vec4_t *v,
158 graphene_vec4_t *res);
161 const graphene_vec3_t *v,
162 graphene_vec3_t *res);
165 const graphene_point_t *p,
166 graphene_point_t *res);
169 const graphene_point3d_t *p,
170 graphene_point3d_t *res);
173 const graphene_rect_t *r,
174 graphene_quad_t *res);
177 const graphene_rect_t *r,
178 graphene_rect_t *res);
181 const graphene_sphere_t *s,
182 graphene_sphere_t *res);
185 const graphene_box_t *b,
186 graphene_box_t *res);
189 const graphene_ray_t *r,
190 graphene_ray_t *res);
191
194 const graphene_point_t *p,
195 graphene_point_t *res);
198 const graphene_rect_t *r,
199 graphene_rect_t *res);
202 const graphene_rect_t *r,
203 graphene_quad_t *res);
206 const graphene_point_t *p,
207 const graphene_rect_t *bounds,
208 graphene_point_t *res);
211 const graphene_rect_t *r,
212 const graphene_rect_t *bounds,
213 graphene_rect_t *res);
216 const graphene_matrix_t *modelview,
217 const graphene_point3d_t *point,
218 graphene_point3d_t *res);
219
222 const graphene_point3d_t *pos);
225 float angle,
226 const graphene_vec3_t *axis);
229 float angle);
232 float angle);
235 float angle);
238 const graphene_quaternion_t *q);
241 const graphene_euler_t *e);
244 float factor_x,
245 float factor_y,
246 float factor_z);
249 float factor);
252 float factor);
255 float factor);
256
259 graphene_matrix_t *res);
262 graphene_matrix_t *res);
265 float depth,
266 graphene_matrix_t *res);
269 graphene_matrix_t *res);
270
277
284
287 const graphene_matrix_t *b,
288 double factor,
289 graphene_matrix_t *res);
290
293 const graphene_matrix_t *b,
294 float epsilon);
297 const graphene_matrix_t *b);
300 const graphene_matrix_t *b);
301
304
307 graphene_vec3_t *translate,
308 graphene_vec3_t *scale,
309 graphene_quaternion_t *rotate,
310 graphene_vec3_t *shear,
311 graphene_vec4_t *perspective);
312
guint depth
#define GRAPHENE_END_DECLS
#define GRAPHENE_BEGIN_DECLS
#define GRAPHENE_PRIVATE_FIELD(type, name)
GRAPHENE_AVAILABLE_IN_1_0 bool graphene_matrix_is_2d(const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_to_float(const graphene_matrix_t *m, float *v)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_matrix_project_rect(const graphene_matrix_t *m, const graphene_rect_t *r, graphene_quad_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_skew_xy(graphene_matrix_t *m, float factor)
GRAPHENE_AVAILABLE_IN_1_0 bool graphene_matrix_is_singular(const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_init_scale(graphene_matrix_t *m, float x, float y, float z)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_skew_yz(graphene_matrix_t *m, float factor)
GRAPHENE_AVAILABLE_IN_1_10 bool graphene_matrix_equal_fast(const graphene_matrix_t *a, const graphene_matrix_t *b)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_matrix_transform_point3d(const graphene_matrix_t *m, const graphene_point3d_t *p, graphene_point3d_t *res)
GRAPHENE_AVAILABLE_IN_1_10 bool graphene_matrix_near(const graphene_matrix_t *a, const graphene_matrix_t *b, float epsilon)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_init_look_at(graphene_matrix_t *m, const graphene_vec3_t *eye, const graphene_vec3_t *center, const graphene_vec3_t *up)
GRAPHENE_AVAILABLE_IN_1_2 graphene_matrix_t * graphene_matrix_init_frustum(graphene_matrix_t *m, float left, float right, float bottom, float top, float z_near, float z_far)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_matrix_transform_sphere(const graphene_matrix_t *m, const graphene_sphere_t *s, graphene_sphere_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_interpolate(const graphene_matrix_t *a, const graphene_matrix_t *b, double factor, graphene_matrix_t *res)
GRAPHENE_AVAILABLE_IN_1_0 float graphene_matrix_get_value(const graphene_matrix_t *m, unsigned int row, unsigned int col)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_matrix_transform_box(const graphene_matrix_t *m, const graphene_box_t *b, graphene_box_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_transform_point(const graphene_matrix_t *m, const graphene_point_t *p, graphene_point_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_perspective(const graphene_matrix_t *m, float depth, graphene_matrix_t *res)
GRAPHENE_AVAILABLE_IN_1_0 bool graphene_matrix_to_2d(const graphene_matrix_t *m, double *xx, double *yx, double *xy, double *yy, double *x_0, double *y_0)
GRAPHENE_AVAILABLE_IN_1_10 float graphene_matrix_get_z_translation(const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_init_perspective(graphene_matrix_t *m, float fovy, float aspect, float z_near, float z_far)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_init_skew(graphene_matrix_t *m, float x_skew, float y_skew)
GRAPHENE_AVAILABLE_IN_1_0 float graphene_matrix_get_x_scale(const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 bool graphene_matrix_inverse(const graphene_matrix_t *m, graphene_matrix_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_untransform_bounds(const graphene_matrix_t *m, const graphene_rect_t *r, const graphene_rect_t *bounds, graphene_rect_t *res)
GRAPHENE_AVAILABLE_IN_1_10 bool graphene_matrix_equal(const graphene_matrix_t *a, const graphene_matrix_t *b)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_rotate(graphene_matrix_t *m, float angle, const graphene_vec3_t *axis)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_init_ortho(graphene_matrix_t *m, float left, float right, float top, float bottom, float z_near, float z_far)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_print(const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_free(graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_get_row(const graphene_matrix_t *m, unsigned int index_, graphene_vec4_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_rotate_x(graphene_matrix_t *m, float angle)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_scale(graphene_matrix_t *m, float factor_x, float factor_y, float factor_z)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_init_rotate(graphene_matrix_t *m, float angle, const graphene_vec3_t *axis)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_project_rect_bounds(const graphene_matrix_t *m, const graphene_rect_t *r, graphene_rect_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_project_point(const graphene_matrix_t *m, const graphene_point_t *p, graphene_point_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_normalize(const graphene_matrix_t *m, graphene_matrix_t *res)
GRAPHENE_AVAILABLE_IN_1_0 float graphene_matrix_get_y_scale(const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_10 bool graphene_matrix_decompose(const graphene_matrix_t *m, graphene_vec3_t *translate, graphene_vec3_t *scale, graphene_quaternion_t *rotate, graphene_vec3_t *shear, graphene_vec4_t *perspective)
GRAPHENE_AVAILABLE_IN_1_0 float graphene_matrix_determinant(const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_translate(graphene_matrix_t *m, const graphene_point3d_t *pos)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_init_identity(graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_skew_xz(graphene_matrix_t *m, float factor)
GRAPHENE_AVAILABLE_IN_1_0 float graphene_matrix_get_z_scale(const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_init_from_float(graphene_matrix_t *m, const float *v)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_init_from_2d(graphene_matrix_t *m, double xx, double yx, double xy, double yy, double x_0, double y_0)
GRAPHENE_AVAILABLE_IN_1_10 float graphene_matrix_get_x_translation(const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_multiply(const graphene_matrix_t *a, const graphene_matrix_t *b, graphene_matrix_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_rotate_y(graphene_matrix_t *m, float angle)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_rotate_z(graphene_matrix_t *m, float angle)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_matrix_unproject_point3d(const graphene_matrix_t *projection, const graphene_matrix_t *modelview, const graphene_point3d_t *point, graphene_point3d_t *res)
GRAPHENE_AVAILABLE_IN_1_10 float graphene_matrix_get_y_translation(const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_init_from_vec4(graphene_matrix_t *m, const graphene_vec4_t *v0, const graphene_vec4_t *v1, const graphene_vec4_t *v2, const graphene_vec4_t *v3)
GRAPHENE_AVAILABLE_IN_1_0 bool graphene_matrix_is_identity(const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_4 void graphene_matrix_transform_ray(const graphene_matrix_t *m, const graphene_ray_t *r, graphene_ray_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_transpose(const graphene_matrix_t *m, graphene_matrix_t *res)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_init_translate(graphene_matrix_t *m, const graphene_point3d_t *p)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_transform_bounds(const graphene_matrix_t *m, const graphene_rect_t *r, graphene_rect_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_transform_rect(const graphene_matrix_t *m, const graphene_rect_t *r, graphene_quad_t *res)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_init_from_matrix(graphene_matrix_t *m, const graphene_matrix_t *src)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_matrix_rotate_quaternion(graphene_matrix_t *m, const graphene_quaternion_t *q)
GRAPHENE_AVAILABLE_IN_1_0 graphene_matrix_t * graphene_matrix_alloc(void)
GRAPHENE_AVAILABLE_IN_1_0 bool graphene_matrix_is_backface_visible(const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 bool graphene_matrix_untransform_point(const graphene_matrix_t *m, const graphene_point_t *p, const graphene_rect_t *bounds, graphene_point_t *res)
GRAPHENE_AVAILABLE_IN_1_2 void graphene_matrix_rotate_euler(graphene_matrix_t *m, const graphene_euler_t *e)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_transform_vec3(const graphene_matrix_t *m, const graphene_vec3_t *v, graphene_vec3_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_matrix_transform_vec4(const graphene_matrix_t *m, const graphene_vec4_t *v, graphene_vec4_t *res)
#define GRAPHENE_AVAILABLE_IN_1_4
#define GRAPHENE_AVAILABLE_IN_1_2
#define GRAPHENE_AVAILABLE_IN_1_10
#define GRAPHENE_AVAILABLE_IN_1_0
int value
Definition lsqlite3.c:2155
lu_byte right
lu_byte left
CURL_EXTERN CURLMcode curl_socket_t s
Definition multi.h:318
GRAPHENE_ALIGNED_DECL(GRAPHENE_PRIVATE_FIELD(graphene_simd4x4f_t, value), 16)