col.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "matrix3.h"
  19. #include "vector3.h"
  20. #include "cvec.h"
  21. typedef enum
  22. {
  23. itIntersects,
  24. itA0, itA1, itA2,
  25. itB0, itB1, itB2,
  26. itA0B0, itA0B1, itA0B2,
  27. itA1B0, itA1B1, itA1B2,
  28. itA2B0, itA2B1, itA2B2
  29. }
  30. IntersectType;
  31. typedef struct
  32. {
  33. Vector center;
  34. Vector basis[3];
  35. Vector extent;
  36. Vector velocity;
  37. }
  38. Box;
  39. class BoxClass
  40. {
  41. public:
  42. BoxClass(Box box);
  43. Vector3 Center;
  44. Vector3 Extent;
  45. Vector3 Velocity;
  46. Matrix3 Basis;
  47. };
  48. IntersectType Boxes_Intersect(const BoxClass & box0, const BoxClass & box1);
  49. IntersectType Boxes_Intersect(const BoxClass & box0, const BoxClass & box1,float dt);
  50. IntersectType BoxesIntersect(float dt, const Box & box0, const Box & box1);