2
0

physcoltest.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : WWPHYS *
  23. * *
  24. * $Archive:: /Commando/Code/wwphys/physcoltest.h $*
  25. * *
  26. * Author:: Greg Hjelstrom *
  27. * *
  28. * $Modtime:: 3/16/00 2:09p $*
  29. * *
  30. * $Revision:: 7 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef PHYSCOLTEST_H
  39. #define PHYSCOLTEST_H
  40. #include "always.h"
  41. #include "coltest.h"
  42. class PhysClass;
  43. ///////////////////////////////////////////////////////////////////////////
  44. //
  45. // Derived versions of the Collision Test Classes which contain
  46. // a pointer to the 'CollidedPhysObj'. This will be set to point at the
  47. // phys object collided with (if any).
  48. //
  49. ///////////////////////////////////////////////////////////////////////////
  50. class PhysRayCollisionTestClass : public RayCollisionTestClass
  51. {
  52. public:
  53. /*
  54. ** To create a PhysRayCollisionTest, you need the following
  55. ** ray - the ray you want to test
  56. ** res - pointer to a result struct to put results in
  57. ** group - collision group of the object making query
  58. */
  59. PhysRayCollisionTestClass(const LineSegClass & ray,CastResultStruct * res,int group,int type = COLLISION_TYPE_PROJECTILE) :
  60. RayCollisionTestClass(ray,res,type),
  61. CollidedPhysObj(NULL),
  62. CollisionGroup(group),
  63. CheckStaticObjs(true),
  64. CheckDynamicObjs(true)
  65. {
  66. }
  67. PhysClass * CollidedPhysObj;
  68. int CollisionGroup;
  69. bool CheckStaticObjs;
  70. bool CheckDynamicObjs;
  71. private:
  72. // not implemented:
  73. PhysRayCollisionTestClass(const PhysRayCollisionTestClass & );
  74. PhysRayCollisionTestClass & operator = (const PhysRayCollisionTestClass & );
  75. };
  76. class PhysAABoxCollisionTestClass : public AABoxCollisionTestClass
  77. {
  78. public:
  79. /*
  80. ** To create a PhysAABoxCollisionTest, you need the following
  81. ** box - the axis aligned box you are testing
  82. ** move - its move vector
  83. ** res - pointer to a result struct to put results in
  84. ** group - collision group of the object making query
  85. */
  86. PhysAABoxCollisionTestClass(const AABoxClass & aabox,const Vector3 & move,CastResultStruct * res,int group,int type = COLLISION_TYPE_PHYSICAL) :
  87. AABoxCollisionTestClass(aabox,move,res,type),
  88. CollidedPhysObj(NULL),
  89. CollisionGroup(group),
  90. CheckStaticObjs(true),
  91. CheckDynamicObjs(true)
  92. {
  93. }
  94. PhysClass * CollidedPhysObj;
  95. int CollisionGroup;
  96. bool CheckStaticObjs;
  97. bool CheckDynamicObjs;
  98. private:
  99. // not implemented:
  100. PhysAABoxCollisionTestClass(const PhysAABoxCollisionTestClass & );
  101. PhysAABoxCollisionTestClass & operator = (const PhysAABoxCollisionTestClass & );
  102. };
  103. class PhysOBBoxCollisionTestClass : public OBBoxCollisionTestClass
  104. {
  105. public:
  106. /*
  107. ** To create a PhysOBBoxCollisionTest, you need the following
  108. ** obbox - the oriented box you are testing
  109. ** move - its move vector
  110. ** res - pointer to a result struct to put results in
  111. ** group - collision group of the object making query
  112. */
  113. PhysOBBoxCollisionTestClass(const OBBoxClass & box,const Vector3 & move,CastResultStruct * res,int group,int type = COLLISION_TYPE_PHYSICAL) :
  114. OBBoxCollisionTestClass(box,move,res,type),
  115. CollidedPhysObj(NULL),
  116. CollisionGroup(group),
  117. CheckStaticObjs(true),
  118. CheckDynamicObjs(true)
  119. {
  120. }
  121. PhysClass * CollidedPhysObj;
  122. int CollisionGroup;
  123. bool CheckStaticObjs;
  124. bool CheckDynamicObjs;
  125. private:
  126. // not implemented:
  127. PhysOBBoxCollisionTestClass(const PhysOBBoxCollisionTestClass & );
  128. PhysOBBoxCollisionTestClass & operator = (const PhysOBBoxCollisionTestClass & );
  129. };
  130. #endif