worldman_moveable.h 785 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. typedef struct record_moveable_s
  2. {
  3. int timestamp;
  4. idVec3 position;
  5. idMat3 angle;
  6. bool done;
  7. } record_moveable_t;
  8. class idWorldManager_Moveable : public idEntity
  9. {
  10. public:
  11. CLASS_PROTOTYPE( idWorldManager_Moveable );
  12. void Spawn( void );
  13. virtual void Think( void );
  14. void Event_startplay( void );
  15. void Event_startrecord( bool continuation );
  16. void Event_stop( void );
  17. private:
  18. idEntityPtr<idEntity> targetEnt;
  19. idList<record_moveable_t> events;
  20. int state;
  21. enum { OFF, RECORDING, PLAYING };
  22. int index;
  23. void UpdateRecord( void );
  24. void UpdatePlay( void );
  25. idVec3 lastPosition;
  26. int lastRecordTime;
  27. int lastTimestamp;
  28. int startTime;
  29. };