00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00036 class PG_API pgMot
00037 {
00038 friend class pgJoin;
00039
00040 public:
00041 pgDefineException(ExceptionInvalidArgument);
00042 pgDefineException(ExceptionInvalidCall);
00043 pgDefineException(ExceptionNotInitialized);
00044
00045 enum PlayMode
00046 {
00047 PLAY_NORMAL,
00048 PLAY_LOOP,
00049 PLAY_KEEP
00050 };
00051
00052 pgMot();
00053 ~pgMot();
00054
00055 void init(pgMdl* mdl, pgID mot_data_id);
00056
00057 u16 getMotionIndex() const;
00058 PlayMode getPlayMode() const;
00059 r32 getPlaySpeed() const;
00060 u16 getInterpFrame() const;
00061
00062 bool isPlaying() const;
00063 void play(pgMdl* mdl, u16 mot_index, PlayMode play_mode, r32 play_speed, u16 interp_frame);
00064 void stop();
00065
00066 r32 getNextUpdateFrame() const;
00067 void update(pgMdl* mdl);
00068
00069 private:
00073 struct InterpInfo
00074 {
00075 pgQuat quat;
00076 pgVec trans;
00077 };
00078
00079 pgMot(const pgMot&);
00080 void operator=(const pgMot&);
00081
00082 void uninit();
00083
00084 pgMotData m_mot_data;
00085 InterpInfo* m_interp_info;
00086 pgType<u8, PlayMode> m_play_mode;
00087 u16 m_mot_index;
00088 u16 m_interp_frame;
00089 r32 m_play_speed;
00090 r32 m_playing_frame;
00091 r32 m_interp_speed;
00092 r32 m_interp_ratio;
00093 };