assimpAppSequence.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #ifndef _MMATH_H_
  3. #include "math/mMath.h"
  4. #endif
  5. #ifndef _TVECTOR_H_
  6. #include "core/util/tVector.h"
  7. #endif
  8. #ifndef _TSSHAPE_H_
  9. #include "ts/tsShape.h"
  10. #endif
  11. #ifndef _APPNODE_H_
  12. #include "ts/loader/appNode.h"
  13. #endif
  14. #ifndef _APPMESH_H_
  15. #include "ts/loader/appMesh.h"
  16. #endif
  17. #ifndef _APPSEQUENCE_H_
  18. #include "ts/loader/appSequence.h"
  19. #endif
  20. #if !defined(TORQUE_DISABLE_MEMORY_MANAGER)
  21. #ifdef new
  22. #undef new
  23. #endif
  24. #endif
  25. #include <assimp/scene.h>
  26. #if !defined(TORQUE_DISABLE_MEMORY_MANAGER)
  27. # define _new new(__FILE__, __LINE__)
  28. # define new _new
  29. #endif
  30. class AssimpAppSequence : public AppSequence
  31. {
  32. String mSequenceName;
  33. F32 seqStart;
  34. F32 seqEnd;
  35. F32 mTimeMultiplier; // The factor needed to convert the sequence data timestamp to seconds
  36. void determineTimeMultiplier(aiAnimation* a);
  37. void calculateSequenceEnd(aiAnimation* a);
  38. public:
  39. AssimpAppSequence(aiAnimation *a);
  40. ~AssimpAppSequence();
  41. aiAnimation *mAnim;
  42. void setActive(bool active) override;
  43. S32 getNumTriggers() const override { return 0; }
  44. void getTrigger(S32 index, TSShape::Trigger& trigger) const override { trigger.state = 0; }
  45. const char* getName() const override { return mSequenceName.c_str(); }
  46. F32 getStart() const override { return seqStart; }
  47. F32 getEnd() const override { return seqEnd; }
  48. void setEnd(F32 end) { seqEnd = end; }
  49. U32 getFlags() const override;
  50. F32 getPriority() const override;
  51. F32 getBlendRefTime() const override;
  52. };