citro3d  1.2.0
types.h
Go to the documentation of this file.
1 #pragma once
2 #ifdef _3DS
3 #include <3ds.h>
4 #else
5 #include <stdbool.h>
6 #include <stdint.h>
7 typedef uint8_t u8;
8 typedef uint32_t u32;
9 #endif
10 
11 #ifndef CITRO3D_NO_DEPRECATION
12 #define C3D_DEPRECATED __attribute__ ((deprecated))
13 #else
14 #define C3D_DEPRECATED
15 #endif
16 
17 typedef u32 C3D_IVec;
18 
19 static inline C3D_IVec IVec_Pack(u8 x, u8 y, u8 z, u8 w)
20 {
21  return (u32)x | ((u32)y << 8) | ((u32)z << 16) | ((u32)w << 24);
22 }
23 
36 typedef union
37 {
41  struct
42  {
43  float w;
44  float z;
45  float y;
46  float x;
47  };
48 
52  struct
53  {
54  float r;
55  float k;
56  float j;
57  float i;
58  };
59 
63  float c[4];
64 } C3D_FVec;
65 
71 
76 typedef union
77 {
78  C3D_FVec r[4];
79  float m[4*4];
80 } C3D_Mtx;
C3D_FVec C3D_FQuat
Definition: types.h:70
static C3D_IVec IVec_Pack(u8 x, u8 y, u8 z, u8 w)
Definition: types.h:19
u32 C3D_IVec
Definition: types.h:17
Float vector.
Definition: types.h:37
float x
X-component.
Definition: types.h:46
float j
J-component.
Definition: types.h:56
float z
Z-component.
Definition: types.h:44
float w
W-component.
Definition: types.h:43
float k
K-component.
Definition: types.h:55
float r
Real component.
Definition: types.h:54
float i
I-component.
Definition: types.h:57
float y
Y-component.
Definition: types.h:45
Row-major 4x4 matrix.
Definition: types.h:77