coltype.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 : WW3D *
  23. * *
  24. * $Archive:: /Commando/Code/ww3d2/coltype.h $*
  25. * *
  26. * Original Author:: Greg Hjelstrom *
  27. * *
  28. * $Author:: Greg_h $*
  29. * *
  30. * $Modtime:: 1/08/01 10:04a $*
  31. * *
  32. * $Revision:: 1 $*
  33. * *
  34. *---------------------------------------------------------------------------------------------*
  35. * Functions: *
  36. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37. #if defined(_MSC_VER)
  38. #pragma once
  39. #endif
  40. #ifndef COLTYPE_H
  41. #define COLTYPE_H
  42. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  43. //
  44. // Collision 'Types'
  45. //
  46. // This enum defines the collision type bit-field that is used in render object
  47. // collision detection.
  48. //
  49. // The collision type field in a collision or intersection test is used as a
  50. // low-level collision mask. It will be 'AND'ed with the collision type of
  51. // the render object and will ignore the object unless the result is
  52. // non-zero. In Commando, we use this to implement separate collision
  53. // representations for "physical" collisions versus "projectile"
  54. // collisions. I.e. we use a very simple mesh for the character's
  55. // physical collision and a more complex set of meshes for checking whether
  56. // a bullet hits a person. This masking system is not meant to be a general
  57. // "collision grouping" system. You should use a higher level system for doing
  58. // things like making bullets ignore each other, etc.
  59. //
  60. // One more wrinkle to the system: The collision type in the render obj
  61. // will always have the LSB set (COLLISION_TYPE_ALL) so that you can always
  62. // do queries against every piece of geometry in a render obj if desired.
  63. //
  64. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  65. enum
  66. {
  67. COLLISION_TYPE_ALL = 0x01, // perform this test against *EVERYTHING*
  68. COLLISION_TYPE_0 = 0x02, // perform this test against type 0 collision objects
  69. COLLISION_TYPE_1 = 0x04, // perform this test against type 1 collision objects
  70. COLLISION_TYPE_2 = 0x08,
  71. COLLISION_TYPE_3 = 0x10,
  72. COLLISION_TYPE_4 = 0x20,
  73. COLLISION_TYPE_5 = 0x40,
  74. COLLISION_TYPE_6 = 0x80,
  75. COLLISION_TYPE_PHYSICAL = COLLISION_TYPE_0, // physics collisions
  76. COLLISION_TYPE_PROJECTILE = COLLISION_TYPE_1, // projectile collisions
  77. COLLISION_TYPE_VIS = COLLISION_TYPE_2, // "vis node" detection
  78. COLLISION_TYPE_CAMERA = COLLISION_TYPE_3, // camera collision (99% should match physical setting)
  79. COLLISION_TYPE_VEHICLE = COLLISION_TYPE_4, // vehicles will collide with physical and this.
  80. };
  81. #endif