Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
graphene-quaternion.h
Go to the documentation of this file.
1/* graphene-quaternion.h: Quaternion
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-vec4.h"
34
36
37/**
38 * graphene_quaternion_t:
39 *
40 * A quaternion.
41 *
42 * The contents of the #graphene_quaternion_t structure are private
43 * and should never be accessed directly.
44 *
45 * Since: 1.0
46 */
48{
49 /*< private >*/
54};
55
60
63 float x,
64 float y,
65 float z,
66 float w);
71 const graphene_quaternion_t *src);
74 const graphene_vec4_t *src);
77 const graphene_matrix_t *m);
80 float deg_x,
81 float deg_y,
82 float deg_z);
85 float rad_x,
86 float rad_y,
87 float rad_z);
90 float angle,
91 const graphene_vec3_t *axis);
94 const graphene_euler_t *e);
95
98 graphene_vec4_t *res);
104 float *deg_x,
105 float *deg_y,
106 float *deg_z);
109 float *rad_x,
110 float *rad_y,
111 float *rad_z);
114 float *angle,
115 graphene_vec3_t *axis);
116
119 const graphene_quaternion_t *b);
122 const graphene_quaternion_t *b);
131 const graphene_quaternion_t *b,
132 float factor,
136 const graphene_quaternion_t *b,
140 float factor,
144 const graphene_quaternion_t *b,
146
#define GRAPHENE_END_DECLS
#define GRAPHENE_BEGIN_DECLS
GRAPHENE_AVAILABLE_IN_1_2 void graphene_quaternion_to_angles(const graphene_quaternion_t *q, float *deg_x, float *deg_y, float *deg_z)
GRAPHENE_AVAILABLE_IN_1_0 graphene_quaternion_t * graphene_quaternion_alloc(void)
GRAPHENE_AVAILABLE_IN_1_10 void graphene_quaternion_scale(const graphene_quaternion_t *q, float factor, graphene_quaternion_t *res)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_quaternion_to_matrix(const graphene_quaternion_t *q, graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_4 void graphene_quaternion_to_radians(const graphene_quaternion_t *q, float *rad_x, float *rad_y, float *rad_z)
GRAPHENE_AVAILABLE_IN_1_0 graphene_quaternion_t * graphene_quaternion_init_identity(graphene_quaternion_t *q)
GRAPHENE_AVAILABLE_IN_1_0 graphene_quaternion_t * graphene_quaternion_init_from_angles(graphene_quaternion_t *q, float deg_x, float deg_y, float deg_z)
GRAPHENE_AVAILABLE_IN_1_4 graphene_quaternion_t * graphene_quaternion_init_from_radians(graphene_quaternion_t *q, float rad_x, float rad_y, float rad_z)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_quaternion_free(graphene_quaternion_t *q)
GRAPHENE_AVAILABLE_IN_1_0 float graphene_quaternion_dot(const graphene_quaternion_t *a, const graphene_quaternion_t *b)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_quaternion_to_angle_vec3(const graphene_quaternion_t *q, float *angle, graphene_vec3_t *axis)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_quaternion_to_vec4(const graphene_quaternion_t *q, graphene_vec4_t *res)
GRAPHENE_AVAILABLE_IN_1_10 void graphene_quaternion_multiply(const graphene_quaternion_t *a, const graphene_quaternion_t *b, graphene_quaternion_t *res)
GRAPHENE_AVAILABLE_IN_1_2 graphene_quaternion_t * graphene_quaternion_init_from_euler(graphene_quaternion_t *q, const graphene_euler_t *e)
GRAPHENE_AVAILABLE_IN_1_0 graphene_quaternion_t * graphene_quaternion_init(graphene_quaternion_t *q, float x, float y, float z, float w)
GRAPHENE_AVAILABLE_IN_1_10 void graphene_quaternion_add(const graphene_quaternion_t *a, const graphene_quaternion_t *b, graphene_quaternion_t *res)
GRAPHENE_AVAILABLE_IN_1_0 graphene_quaternion_t * graphene_quaternion_init_from_angle_vec3(graphene_quaternion_t *q, float angle, const graphene_vec3_t *axis)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_quaternion_slerp(const graphene_quaternion_t *a, const graphene_quaternion_t *b, float factor, graphene_quaternion_t *res)
GRAPHENE_AVAILABLE_IN_1_0 graphene_quaternion_t * graphene_quaternion_init_from_quaternion(graphene_quaternion_t *q, const graphene_quaternion_t *src)
GRAPHENE_AVAILABLE_IN_1_0 graphene_quaternion_t * graphene_quaternion_init_from_vec4(graphene_quaternion_t *q, const graphene_vec4_t *src)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_quaternion_normalize(const graphene_quaternion_t *q, graphene_quaternion_t *res)
GRAPHENE_AVAILABLE_IN_1_0 graphene_quaternion_t * graphene_quaternion_init_from_matrix(graphene_quaternion_t *q, const graphene_matrix_t *m)
GRAPHENE_AVAILABLE_IN_1_0 void graphene_quaternion_invert(const graphene_quaternion_t *q, graphene_quaternion_t *res)
GRAPHENE_AVAILABLE_IN_1_0 bool graphene_quaternion_equal(const graphene_quaternion_t *a, const graphene_quaternion_t *b)
#define GRAPHENE_AVAILABLE_IN_1_4
#define GRAPHENE_AVAILABLE_IN_1_2
#define GRAPHENE_AVAILABLE_IN_1_10
#define GRAPHENE_AVAILABLE_IN_1_0
GRAPHENE_PRIVATE_FIELD(float, y)
GRAPHENE_PRIVATE_FIELD(float, z)
GRAPHENE_PRIVATE_FIELD(float, w)
GRAPHENE_PRIVATE_FIELD(float, x)