W3DTerrainLogic.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. ** Command & Conquer Generals(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. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: W3DTerrainLogic.h ////////////////////////////////////////////////////////////////////////
  24. // W3D implementation details for logical terrain
  25. // Author: Colin Day, April 2001
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. #pragma once
  28. #ifndef __W3DTERRAINLOGIC_H_
  29. #define __W3DTERRAINLOGIC_H_
  30. #include "GameLogic/TerrainLogic.h"
  31. //-------------------------------------------------------------------------------------------------
  32. /** W3D specific implementation details for logical terrain ... we have this
  33. * because the logic and visual terrain are closely tied together in that
  34. * they represent the same thing, but need to be broken up into logical
  35. * and graphical representations */
  36. //-------------------------------------------------------------------------------------------------
  37. class W3DTerrainLogic : public TerrainLogic
  38. {
  39. public:
  40. W3DTerrainLogic();
  41. virtual ~W3DTerrainLogic();
  42. virtual void init( void ); ///< Init
  43. virtual void reset( void ); ///< Reset
  44. virtual void update( void ); ///< Update
  45. /// @todo The loading of the raw height data should be device independent
  46. virtual Bool loadMap( AsciiString filename , Bool query );
  47. virtual void newMap( Bool saveGame ); ///< Initialize the logic for new map.
  48. virtual Real getGroundHeight( Real x, Real y, Coord3D* normal = NULL ) const;
  49. virtual Bool isCliffCell( Real x, Real y) const; ///< is point cliff cell.
  50. virtual Real getLayerHeight(Real x, Real y, PathfindLayerEnum layer, Coord3D* normal = NULL, Bool clip = true) const;
  51. virtual void getExtent( Region3D *extent ) const ; ///< Get the 3D extent of the terrain in world coordinates
  52. virtual void getMaximumPathfindExtent( Region3D *extent ) const;
  53. virtual void getExtentIncludingBorder( Region3D *extent ) const;
  54. virtual Bool isClearLineOfSight(const Coord3D& pos, const Coord3D& posOther) const;
  55. protected:
  56. // snapshot methods
  57. virtual void crc( Xfer *xfer );
  58. virtual void xfer( Xfer *xfer );
  59. virtual void loadPostProcess( void );
  60. Real m_mapMinZ; ///< Minimum terrain z value.
  61. Real m_mapMaxZ; ///< Maximum terrain z value.
  62. }; // end W3DTerrainLogic
  63. #endif // end __W3DTERRAINLOGIC_H_