projector.h 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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/projector.h $*
  25. * *
  26. * Original Author:: Greg Hjelstrom *
  27. * *
  28. * $Author:: Greg_h $*
  29. * *
  30. * $Modtime:: 2/07/01 2:07p $*
  31. * *
  32. * $Revision:: 2 $*
  33. * *
  34. *---------------------------------------------------------------------------------------------*
  35. * Functions: *
  36. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37. #ifndef PROJECTOR_H
  38. #define PROJECTOR_H
  39. #include "always.h"
  40. #include "matrix3d.h"
  41. #include "matrix4.h"
  42. #include "aabox.h"
  43. #include "obbox.h"
  44. class MatrixMapperClass;
  45. /**
  46. ** ProjectorClass
  47. ** This is a class which encapsulates the data needed to describe a projection. It isn't
  48. ** really useful by itself but it is a common base class between TexProjectClass and DecalGeneratorClass.
  49. */
  50. class ProjectorClass
  51. {
  52. public:
  53. ProjectorClass(void);
  54. virtual ~ProjectorClass(void);
  55. virtual void Set_Transform(const Matrix3D & tm);
  56. virtual const Matrix3D & Get_Transform(void) const;
  57. virtual void Set_Perspective_Projection(float hfov,float vfov,float znear,float zfar);
  58. virtual void Set_Ortho_Projection(float xmin,float xmax,float ymin,float ymax,float znear,float zfar);
  59. const OBBoxClass & Get_Bounding_Volume(void) const { return WorldBoundingVolume; }
  60. void Compute_Texture_Coordinate(const Vector3 & point,Vector3 * set_stq);
  61. protected:
  62. virtual void Update_WS_Bounding_Volume(void);
  63. Matrix3D Transform;
  64. Matrix4 Projection;
  65. AABoxClass LocalBoundingVolume;
  66. OBBoxClass WorldBoundingVolume;
  67. MatrixMapperClass * Mapper;
  68. };
  69. #endif