2
0

b3Int4.h 940 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef B3_INT4_H
  2. #define B3_INT4_H
  3. #ifdef __cplusplus
  4. #include "Bullet3Common/b3Scalar.h"
  5. B3_ATTRIBUTE_ALIGNED16(struct) b3UnsignedInt4
  6. {
  7. B3_DECLARE_ALIGNED_ALLOCATOR();
  8. union
  9. {
  10. struct
  11. {
  12. unsigned int x,y,z,w;
  13. };
  14. struct
  15. {
  16. unsigned int s[4];
  17. };
  18. };
  19. };
  20. B3_ATTRIBUTE_ALIGNED16(struct) b3Int4
  21. {
  22. B3_DECLARE_ALIGNED_ALLOCATOR();
  23. union
  24. {
  25. struct
  26. {
  27. int x,y,z,w;
  28. };
  29. struct
  30. {
  31. int s[4];
  32. };
  33. };
  34. };
  35. B3_FORCE_INLINE b3Int4 b3MakeInt4(int x, int y, int z, int w = 0)
  36. {
  37. b3Int4 v;
  38. v.s[0] = x; v.s[1] = y; v.s[2] = z; v.s[3] = w;
  39. return v;
  40. }
  41. B3_FORCE_INLINE b3UnsignedInt4 b3MakeUnsignedInt4(unsigned int x, unsigned int y, unsigned int z, unsigned int w = 0)
  42. {
  43. b3UnsignedInt4 v;
  44. v.s[0] = x; v.s[1] = y; v.s[2] = z; v.s[3] = w;
  45. return v;
  46. }
  47. #else
  48. #define b3UnsignedInt4 uint4
  49. #define b3Int4 int4
  50. #define b3MakeInt4 (int4)
  51. #define b3MakeUnsignedInt4 (uint4)
  52. #endif //__cplusplus
  53. #endif //B3_INT4_H