Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ParticleMass.h 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
  2. /*================================================================
  3. *
  4. * Project : Hel
  5. * Author : Terry 'Mongoose' Hendrix II
  6. * Website : http://www.westga.edu/~stu7440/
  7. * Email : stu7440@westga.edu
  8. * Object : Particle
  9. * License : No use w/o permission (C) 2001-2003 Mongoose
  10. * Comments: Partcle system's atomic base
  11. *
  12. *
  13. * This file was generated using Mongoose's C++
  14. * template generator script. <stu7440@westga.edu>
  15. *
  16. *-- History ------------------------------------------------
  17. *
  18. * 2003.06.02:
  19. * Mongoose - Now using Hel mass system
  20. *
  21. * 2001.08.13:
  22. * Mongoose - Created
  23. ================================================================*/
  24. #ifndef __HEL_MONGOOSE_PARTICLEMASS_H_
  25. #define __HEL_MONGOOSE_PARTICLEMASS_H_
  26. #include <hel/Mass.h>
  27. class ParticleMass
  28. {
  29. public:
  30. ////////////////////////////////////////////////////////////
  31. // Constructors
  32. ////////////////////////////////////////////////////////////
  33. ParticleMass();
  34. /*------------------------------------------------------
  35. * Pre :
  36. * Post : Constructs an object of Particle
  37. *
  38. *-- History ------------------------------------------
  39. *
  40. * 2001.08.13:
  41. * Mongoose - Created
  42. ------------------------------------------------------*/
  43. ~ParticleMass();
  44. /*------------------------------------------------------
  45. * Pre : Particle object is allocated
  46. * Post : Deconstructs an object of Particle
  47. *
  48. *-- History ------------------------------------------
  49. *
  50. * 2001.08.13:
  51. * Mongoose - Created
  52. ------------------------------------------------------*/
  53. void simulate(vec_t timeDelta)
  54. {
  55. /*------------------------------------------------------
  56. * Pre :
  57. * Post : Ajusts for particle life cycle
  58. *
  59. *-- History ------------------------------------------
  60. *
  61. * 2001.08.13:
  62. * Mongoose - Created
  63. ------------------------------------------------------*/
  64. mLife -= mBlend * timeDelta;
  65. // Reset 'dead' OR fully blended particles
  66. if (mLife < 0.0)
  67. {
  68. mLife = 1.0;
  69. }
  70. mMass->simulate(timeDelta);
  71. }
  72. ////////////////////////////////////////////////////////////
  73. // Public Accessors
  74. ////////////////////////////////////////////////////////////
  75. ////////////////////////////////////////////////////////////
  76. // Public Mutators
  77. ////////////////////////////////////////////////////////////
  78. Mass *mMass; /* Particle mass */
  79. bool mActive; /* Is this particle in use? */
  80. int mTextureId; /* Texture Id to use on polygon */
  81. vec_t mLife; /* Life of particle */
  82. vec_t mBlend; /* Blend amount or fade per sec */
  83. vec3_t mColor; /* Current color */
  84. private:
  85. ////////////////////////////////////////////////////////////
  86. // Private Accessors
  87. ////////////////////////////////////////////////////////////
  88. ////////////////////////////////////////////////////////////
  89. // Private Mutators
  90. ////////////////////////////////////////////////////////////
  91. };
  92. #endif