AnimationValue.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef ANIMATIONVALUE_H_
  2. #define ANIMATIONVALUE_H_
  3. #include "Animation.h"
  4. namespace gameplay
  5. {
  6. /**
  7. * The runtime interface to represent an animation value.
  8. */
  9. class AnimationValue
  10. {
  11. friend class AnimationClip;
  12. public:
  13. /**
  14. * Gets the value at the specified index.
  15. *
  16. * @param index The index of the component to get the value for.
  17. *
  18. * @return The float value at the specified index.
  19. */
  20. float getFloat(unsigned int index) const;
  21. /**
  22. * Sets the value at the specified index.
  23. *
  24. * @param index The index of the component to set the value for.
  25. * @param value The value to set the component to.
  26. */
  27. void setFloat(unsigned int index, float value);
  28. /**
  29. * Gets the value of the AnimationValue in a float array.
  30. *
  31. * @param value The array to populate with the AnimationValue's values.
  32. * @param offset The offset into the value to start populating.
  33. * @param length The number of values to copy into the array.
  34. */
  35. void getFloat(float* value, unsigned int offset, unsigned int length) const;
  36. /**
  37. * Sets the value of the AnimationValue.
  38. *
  39. * @param value The array to populate the AnimationValue's values.
  40. * @param offset The offset into the value array to start populating from.
  41. * @param length The number of values to copy into the AnimationValue.
  42. */
  43. void setFloat(float* value, unsigned int offset, unsigned int length);
  44. private:
  45. /**
  46. * Constructor.
  47. */
  48. AnimationValue();
  49. /**
  50. * Constructor.
  51. */
  52. AnimationValue(unsigned int componentCount);
  53. /**
  54. * Constructor.
  55. */
  56. AnimationValue(const AnimationValue& copy);
  57. /**
  58. * Destructor.
  59. */
  60. ~AnimationValue();
  61. unsigned int _componentCount; // The number of float values for the property.
  62. unsigned int _componentSize; // The number of bytes of memory the property is.
  63. float* _value; // The current value of the property.
  64. };
  65. }
  66. #endif