decophys.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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/decophys.h $*
  25. * *
  26. * Author:: Greg Hjelstrom *
  27. * *
  28. * $Modtime:: 1/05/02 3:55p $*
  29. * *
  30. * $Revision:: 17 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef DECOPHYS_H
  39. #define DECOPHYS_H
  40. #include "always.h"
  41. #include "dynamicphys.h"
  42. #include "pscene.h"
  43. #include "wwdebug.h"
  44. #include "physcoltest.h"
  45. class DecorationPhysDefClass;
  46. /**
  47. ** DecorationPhysClass
  48. ** Decoration object. It is an object that can be added into the dynamic physics
  49. ** system but doesn't really do anything. It can be collided against if collision is
  50. ** enabled in its render object...
  51. */
  52. class DecorationPhysClass : public DynamicPhysClass
  53. {
  54. public:
  55. DecorationPhysClass(void);
  56. virtual DecorationPhysClass * As_DecorationPhysClass(void) { return this; }
  57. void Init(const DecorationPhysDefClass & def);
  58. virtual void Timestep(float dt) { }
  59. virtual void Set_Model(RenderObjClass * model);
  60. virtual bool Cast_Ray(PhysRayCollisionTestClass & raytest);
  61. virtual bool Cast_AABox(PhysAABoxCollisionTestClass & boxtest);
  62. virtual bool Cast_OBBox(PhysOBBoxCollisionTestClass & boxtest);
  63. virtual bool Intersection_Test(PhysAABoxIntersectionTestClass & test);
  64. virtual bool Intersection_Test(PhysOBBoxIntersectionTestClass & test);
  65. virtual const AABoxClass & Get_Bounding_Box(void) const;
  66. virtual const Matrix3D & Get_Transform(void) const;
  67. virtual void Set_Transform(const Matrix3D & m);
  68. virtual void Get_Shadow_Blob_Box(AABoxClass * set_obj_space_box);
  69. // save-load system
  70. virtual const PersistFactoryClass & Get_Factory (void) const;
  71. virtual bool Save (ChunkSaveClass &csave);
  72. virtual bool Load (ChunkLoadClass &cload);
  73. virtual void On_Post_Load(void);
  74. private:
  75. // Not implemented...
  76. DecorationPhysClass(const DecorationPhysClass &);
  77. DecorationPhysClass & operator = (const DecorationPhysClass &);
  78. AABoxClass ObjSpaceWorldBox;
  79. };
  80. /**
  81. ** DecorationPhysDefClass
  82. ** Definition data structure for DecorationPhysClass
  83. */
  84. class DecorationPhysDefClass : public DynamicPhysDefClass
  85. {
  86. public:
  87. DecorationPhysDefClass(void);
  88. // From DefinitionClass
  89. virtual uint32 Get_Class_ID (void) const;
  90. virtual PersistClass * Create(void) const;
  91. // From PhysDefClass
  92. virtual const char * Get_Type_Name(void);
  93. virtual bool Is_Type(const char *);
  94. // From PersistClass
  95. virtual const PersistFactoryClass & Get_Factory (void) const;
  96. virtual bool Save(ChunkSaveClass &csave);
  97. virtual bool Load(ChunkLoadClass &cload);
  98. // Editable interface requirements
  99. DECLARE_EDITABLE(DecorationPhysDefClass,DynamicPhysDefClass);
  100. protected:
  101. friend class StaticPhysClass;
  102. };
  103. #endif