Open Broadcaster Software
Free, open source software for live streaming and recording
axisang.h
Go to the documentation of this file.
1 /******************************************************************************
2  Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.com>
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
17 
18 #pragma once
19 
20 #include "../util/c99defs.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 struct quat;
27 
28 struct axisang {
29  union {
30  struct {float x, y, z, w;};
31  float ptr[4];
32  };
33 };
34 
35 static inline void axisang_zero(struct axisang *dst)
36 {
37  dst->x = 0.0f;
38  dst->y = 0.0f;
39  dst->z = 0.0f;
40  dst->w = 0.0f;
41 }
42 
43 static inline void axisang_copy(struct axisang *dst, struct axisang *aa)
44 {
45  dst->x = aa->x;
46  dst->y = aa->y;
47  dst->z = aa->z;
48  dst->w = aa->w;
49 }
50 
51 static inline void axisang_set(struct axisang *dst, float x, float y, float z,
52  float w)
53 {
54  dst->x = x;
55  dst->y = y;
56  dst->z = z;
57  dst->w = w;
58 }
59 
60 EXPORT void axisang_from_quat(struct axisang *dst, const struct quat *q);
61 
62 #ifdef __cplusplus
63 }
64 #endif
Definition: axisang.h:28
float ptr[4]
Definition: axisang.h:31
float w
Definition: axisang.h:30
float z
Definition: axisang.h:30
float y
Definition: axisang.h:30
#define EXPORT
Definition: c99defs.h:49
EXPORT void axisang_from_quat(struct axisang *dst, const struct quat *q)
Definition: quat.h:41
float x
Definition: axisang.h:30