summaryrefslogtreecommitdiff
path: root/thirdparty/bullet/src/Bullet3Common/shared/b3Int4.h
blob: aa02d6beef906a0f55c14c2a166c427ece770a23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef B3_INT4_H
#define B3_INT4_H

#ifdef __cplusplus

#include "Bullet3Common/b3Scalar.h"


B3_ATTRIBUTE_ALIGNED16(struct) b3UnsignedInt4
{
	B3_DECLARE_ALIGNED_ALLOCATOR();

	union
	{
		struct
		{
			unsigned int x,y,z,w;
		};
		struct
		{
			unsigned int s[4];
		};
	};
};

B3_ATTRIBUTE_ALIGNED16(struct) b3Int4
{
	B3_DECLARE_ALIGNED_ALLOCATOR();

	union
	{
		struct
		{
			int x,y,z,w;
		};
		struct
		{
			int s[4];
		};
	};
};

B3_FORCE_INLINE b3Int4 b3MakeInt4(int x, int y, int z, int w = 0)
{
	b3Int4 v;
	v.s[0] = x; v.s[1] = y; v.s[2] = z; v.s[3] = w;
	return v;
}

B3_FORCE_INLINE b3UnsignedInt4 b3MakeUnsignedInt4(unsigned int x, unsigned int y, unsigned int z, unsigned int w = 0)
{
	b3UnsignedInt4 v;
	v.s[0] = x; v.s[1] = y; v.s[2] = z; v.s[3] = w;
	return v;
}

#else


#define b3UnsignedInt4 uint4
#define b3Int4 int4
#define b3MakeInt4 (int4)
#define b3MakeUnsignedInt4 (uint4)


#endif //__cplusplus

#endif //B3_INT4_H