renderobjphys.h 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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/renderobjphys.h $*
  25. * *
  26. * Author:: Greg Hjelstrom *
  27. * *
  28. * $Modtime:: 8/13/00 11:17a $*
  29. * *
  30. * $Revision:: 5 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef RENDEROBJPHYS_H
  39. #define RENDEROBJPHYS_H
  40. #include "always.h"
  41. #include "dynamicphys.h"
  42. #include "pscene.h"
  43. #include "wwdebug.h"
  44. #include "physcoltest.h"
  45. /**
  46. ** RenderObjPhysClass
  47. ** The *ONLY* purpose of this class is as a wrapper when render objects are added
  48. ** directly to the physics scene. This class plugs a pointer back to it into the UserData
  49. ** field of its render object. If you find yourself creating these objects,
  50. ** consider using DecorationPhysClass instead...
  51. */
  52. class RenderObjPhysClass : public DynamicPhysClass
  53. {
  54. public:
  55. RenderObjPhysClass(void);
  56. ~RenderObjPhysClass(void);
  57. virtual void Timestep(float dt) { }
  58. virtual void Set_Model(RenderObjClass * model);
  59. virtual bool Cast_Ray(PhysRayCollisionTestClass & raytest);
  60. virtual bool Cast_AABox(PhysAABoxCollisionTestClass & boxtest);
  61. virtual bool Cast_OBBox(PhysOBBoxCollisionTestClass & boxtest);
  62. virtual const AABoxClass & Get_Bounding_Box(void) const;
  63. virtual const Matrix3D & Get_Transform(void) const;
  64. virtual void Set_Transform(const Matrix3D & m);
  65. virtual RenderObjPhysClass * As_RenderObjPhysClass(void) { return this; }
  66. /*
  67. ** Save-Load
  68. */
  69. virtual const PersistFactoryClass & Get_Factory (void) const;
  70. virtual bool Save (ChunkSaveClass &csave);
  71. virtual bool Load (ChunkLoadClass &cload);
  72. virtual void On_Post_Load (void);
  73. private:
  74. // Not implemented...
  75. RenderObjPhysClass(const RenderObjPhysClass &);
  76. RenderObjPhysClass & operator = (const RenderObjPhysClass &);
  77. };
  78. #endif