animcommand.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //! base class of all commands exposed to script to provide common functionality over animations
  2. class AnimCommandBase
  3. {
  4. // These would be private if not for the scripted commands
  5. // As other commands lifetime are handled internally
  6. protected void AnimCommandBase() {}
  7. protected void ~AnimCommandBase() {}
  8. //! returns entity that this command is bount to
  9. proto native IEntity GetEntity();
  10. //! called when command starts
  11. void OnActivate() {}
  12. //! called when command ends
  13. void OnDeactivate() {}
  14. //! called before any animation is processed
  15. //! here change animation values, add animation commands
  16. void PreAnimUpdate(float pDt) {}
  17. //! after animation is processed, before physics is processed
  18. //! here you can listen to various events
  19. void PrePhysUpdate(float pDt) {}
  20. //! functions usable only from OnActivate or PreAnimUpdate
  21. proto native void PreAnim_CallCommand(int pCommand, int pParamInt, float pParamFloat);
  22. proto native void PreAnim_SetFloat(int pVar, float pFlt);
  23. proto native void PreAnim_SetInt(int pVar, int pInt);
  24. proto native void PreAnim_SetBool(int pVar, bool pBool);
  25. //! functions usable in PrePhysUpdate
  26. proto native bool PrePhys_IsEvent(int pEvent);
  27. proto native bool PrePhys_IsTag(int pTag);
  28. }