Anim3D.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 RWS Inc, All Rights Reserved
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of version 2 of the GNU General Public License as published by
  7. // the Free Software Foundation
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License along
  15. // with this program; if not, write to the Free Software Foundation, Inc.,
  16. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. //
  18. // Anim3D.H
  19. // Project: Postal
  20. //
  21. // History:
  22. // 05/23/97 JMI Started. Moved here from thing.h.
  23. // Also, added events.
  24. //
  25. // 08/07/97 JMI Added m_ptransWeapon rigid body transforms channel for
  26. // weapons.
  27. // Also, added SetLooping().
  28. //
  29. // 08/12/97 BRH Added yet another overloaded Get function which
  30. // in addition to the base name and verb, takes a number
  31. // of a texture scheme to load.
  32. //
  33. //////////////////////////////////////////////////////////////////////////////
  34. //
  35. // 3D animation class that is a collection of channels that make up a 3D
  36. // animation.
  37. //
  38. //////////////////////////////////////////////////////////////////////////////
  39. #ifndef ANIM3D_H
  40. #define ANIM3D_H
  41. #include "RSPiX.h"
  42. // These are the basic components of any 3D animation.
  43. typedef RChannel<RSop> ChanForm; // Channel of SOPs.
  44. typedef RChannel<RMesh> ChanMesh; // Channel of meshes.
  45. typedef RChannel<RTexture> ChanTexture; // Channel of textures.
  46. typedef RChannel<RP3d> ChanHot; // Channel of hotspots.
  47. typedef RChannel<RP3d> ChanBounds; // Channel of bounding
  48. // cylinders for collision.
  49. typedef RChannel<REAL> ChanFloor; // Channel of floor circles
  50. // for attribute map..?
  51. typedef RChannel<RTransform> ChanTransform; // Channel of transforms.
  52. typedef RChannel<U8> ChanEvent; // Channel of event states.
  53. /////////////////////////////////////////////////////////////////////////
  54. // This class describes the components of any 3D animation.
  55. // To add more stuff (e.g., links for rigid bodies and such), descend
  56. // a class from this one and add your members. Note that you will either
  57. // have to load these explicitly (myAnim.m_linkRocket.Load(..) or create
  58. // a new Load() that calls the base class version and then loads your
  59. // new members.
  60. /////////////////////////////////////////////////////////////////////////
  61. class CAnim3D
  62. {
  63. public: // Data corresponding to this animation.
  64. // These are in synch such that a time is
  65. // parallel with a time in any other.
  66. // For example, the m_sops.GetAtTime(1) SOP
  67. // is used with the m_meshes.GetAtTime(1) mesh.
  68. ChanForm* m_psops; // Sea of Pointses.
  69. ChanMesh* m_pmeshes; // Meshes.
  70. ChanTexture* m_ptextures; // Textures.
  71. ChanBounds* m_pbounds; // Description of bounding cylinders.
  72. ChanTransform* m_ptransRigid; // Rigid body transforms.
  73. ChanEvent* m_pevent; // Event states.
  74. ChanTransform* m_ptransWeapon; // Rigid body transforms for weapon
  75. // position.
  76. public: // Methods for this animation.
  77. // Constructor.
  78. CAnim3D();
  79. // Get the various components of this animation from the resource names
  80. // specified in the provided array of pointers to strings.
  81. virtual // If you override this function,
  82. // call base class for default functionality.
  83. short Get( // Returns 0 on success.
  84. char** ppszFileNames); // Pointer to array of pointers to filenames.
  85. // These filenames should be in the order
  86. // the members are listed in this class's
  87. // definition.
  88. // Get the various components of this animation from the resource names
  89. // specified in the provided array of pointers to strings.
  90. virtual // If you override this function,
  91. // call base class for default functionality.
  92. short Get( // Returns 0 on success.
  93. char** ppszFileNames, // Pointer to array of pointers to filenames.
  94. // These filenames should be in the order
  95. // the members are listed in this class's
  96. // definition.
  97. short sLoopFlags); // Looping flags to apply to all channels in this anim
  98. // Get the various components of this animation from the resource names
  99. // specified by base name, optionally, with a rigid name.
  100. virtual // If you override this function,
  101. // call base class for default functionality.
  102. short Get( // Returns 0 on success.
  103. char* pszBaseFileName, // In: Base string for resource filenames.
  104. char* pszRigidName, // In: String to add for rigid transform channel,
  105. // "", or NULL for none.
  106. char* pszEventName, // In: String to add for event states channel,
  107. // "", or NULL for none.
  108. char* pszWeaponTransName, // In: String to add for weapon transforms channel,
  109. // "", or NULL for none.
  110. short sLoopFlags); // In: Looping flags to apply to all channels
  111. // in this anim.
  112. // Get the various components of this animation from the resource names
  113. // specified by base name, optionally, with a rigid name.
  114. virtual // If you override this function,
  115. // call base class for default functionality.
  116. short Get( // Returns 0 on success.
  117. char* pszBaseName, // In: Base string for resource filenames.
  118. char* pszVerb, // In: Action name to be appended to the base
  119. char* pszRigidName, // In: String to add for rigid transform channel,
  120. // "", or NULL for none.
  121. char* pszEventName, // In: String to add for event states channel,
  122. // "", or NULL for none.
  123. char* pszWeaponTransName, // In: String to add for weapon transforms channel,
  124. // "", or NULL for none.
  125. short sLoopFlags); // In: Looping flags to apply to all channels
  126. // in this anim.
  127. // Get the various components of this animation from the resource names
  128. // specified by base name, optionally, with a rigid name.
  129. virtual // If you override this function,
  130. // call base class for default functionality.
  131. short Get( // Returns 0 on success.
  132. char* pszBaseName, // In: Base string for resource filenames.
  133. short sTextureScheme, // In: Number of texture file to be loaded
  134. char* pszVerb, // In: Action name to be appended to the base
  135. char* pszRigidName, // In: String to add for rigid transform channel,
  136. // "", or NULL for none.
  137. char* pszEventName, // In: String to add for event states channel,
  138. // "", or NULL for none.
  139. char* pszWeaponTransName, // In: String to add for weapon transforms channel,
  140. // "", or NULL for none.
  141. short sLoopFlags); // In: Looping flags to apply to all channels
  142. // in this anim.
  143. // Release all resources.
  144. virtual // If you override this function,
  145. // call base class for default functionality.
  146. void Release(void); // Returns nothing.
  147. // Set looping flags for this channel.
  148. virtual // If you override this function,
  149. // call base class for default functionality.
  150. void SetLooping( // Returns nothing.
  151. short sLoopFlags); // In: Looping flags to apply to all channels
  152. // in this anim.
  153. };
  154. #endif // ANIM3D_H
  155. ////////////////////////////////////////////////////////////////////////////////
  156. // EOF
  157. ////////////////////////////////////////////////////////////////////////////////