2
0

b3Int4.h 949 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef B3_INT4_H
  2. #define B3_INT4_H
  3. #ifdef __cplusplus
  4. #include "Bullet3Common/b3Scalar.h"
  5. B3_ATTRIBUTE_ALIGNED16(struct)
  6. b3UnsignedInt4
  7. {
  8. B3_DECLARE_ALIGNED_ALLOCATOR();
  9. union {
  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)
  21. b3Int4
  22. {
  23. B3_DECLARE_ALIGNED_ALLOCATOR();
  24. union {
  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;
  39. v.s[1] = y;
  40. v.s[2] = z;
  41. v.s[3] = w;
  42. return v;
  43. }
  44. B3_FORCE_INLINE b3UnsignedInt4 b3MakeUnsignedInt4(unsigned int x, unsigned int y, unsigned int z, unsigned int w = 0)
  45. {
  46. b3UnsignedInt4 v;
  47. v.s[0] = x;
  48. v.s[1] = y;
  49. v.s[2] = z;
  50. v.s[3] = w;
  51. return v;
  52. }
  53. #else
  54. #define b3UnsignedInt4 uint4
  55. #define b3Int4 int4
  56. #define b3MakeInt4 (int4)
  57. #define b3MakeUnsignedInt4 (uint4)
  58. #endif //__cplusplus
  59. #endif //B3_INT4_H