Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/GameLogic/SCA_IpoActuator.h
- This file was moved from source/gameengine/Ketsji/KX_IpoActuator.h.
| Show All 19 Lines | |||||
| * | * | ||||
| * The Original Code is: all of this file. | * The Original Code is: all of this file. | ||||
| * | * | ||||
| * Contributor(s): none yet. | * Contributor(s): none yet. | ||||
| * | * | ||||
| * ***** END GPL LICENSE BLOCK ***** | * ***** END GPL LICENSE BLOCK ***** | ||||
| */ | */ | ||||
| /** \file KX_IpoActuator.h | /** \file SCA_IpoActuator.h | ||||
| * \ingroup ketsji | * \ingroup ketsji | ||||
| * \brief Do an object ipo | * \brief Do an object ipo | ||||
| */ | */ | ||||
| #ifndef __KX_IPOACTUATOR_H__ | #ifndef __SCA_IPOACTUATOR_H__ | ||||
| #define __KX_IPOACTUATOR_H__ | #define __SCA_IPOACTUATOR_H__ | ||||
| #include "SCA_IActuator.h" | #include "SCA_IActuator.h" | ||||
| class KX_IpoActuator : public SCA_IActuator | class SCA_IpoActuator : public SCA_IActuator | ||||
| { | { | ||||
| Py_Header | Py_Header | ||||
| private: | private: | ||||
| /** Computes the IPO start time from the current time | /** Computes the IPO start time from the current time | ||||
| * and the current frame. */ | * and the current frame. */ | ||||
| void SetStartTime(float curtime); | void SetStartTime(float curtime); | ||||
| /** Computes the current frame from the current time | /** Computes the current frame from the current time | ||||
| * and the IPO start time. */ | * and the IPO start time. */ | ||||
| Show All 39 Lines | protected: | ||||
| bool m_ipo_local; | bool m_ipo_local; | ||||
| bool m_bIpoPlaying; | bool m_bIpoPlaying; | ||||
| /** Reset/Update the start time*/ | /** Reset/Update the start time*/ | ||||
| void ResetStartTime(); | void ResetStartTime(); | ||||
| public: | public: | ||||
| enum IpoActType | enum IpoActType { | ||||
| { | |||||
| KX_ACT_IPO_NODEF = 0, | KX_ACT_IPO_NODEF = 0, | ||||
| KX_ACT_IPO_PLAY, | KX_ACT_IPO_PLAY, | ||||
| KX_ACT_IPO_PINGPONG, | KX_ACT_IPO_PINGPONG, | ||||
| KX_ACT_IPO_FLIPPER, | KX_ACT_IPO_FLIPPER, | ||||
| KX_ACT_IPO_LOOPSTOP, | KX_ACT_IPO_LOOPSTOP, | ||||
| KX_ACT_IPO_LOOPEND, | KX_ACT_IPO_LOOPEND, | ||||
| KX_ACT_IPO_KEY2KEY, | KX_ACT_IPO_KEY2KEY, | ||||
| KX_ACT_IPO_FROM_PROP, | KX_ACT_IPO_FROM_PROP, | ||||
| KX_ACT_IPO_MAX | KX_ACT_IPO_MAX | ||||
| }; | }; | ||||
| #ifdef WITH_PYTHON | |||||
| static PyObject* pyattr_get_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | |||||
| static int pyattr_set_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | |||||
| static PyObject* pyattr_get_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | |||||
| static int pyattr_set_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | |||||
| #endif | |||||
| static const char *S_KX_ACT_IPO_PLAY_STRING; | static const char *S_KX_ACT_IPO_PLAY_STRING; | ||||
| static const char *S_KX_ACT_IPO_PINGPONG_STRING; | static const char *S_KX_ACT_IPO_PINGPONG_STRING; | ||||
| static const char *S_KX_ACT_IPO_FLIPPER_STRING; | static const char *S_KX_ACT_IPO_FLIPPER_STRING; | ||||
| static const char *S_KX_ACT_IPO_LOOPSTOP_STRING; | static const char *S_KX_ACT_IPO_LOOPSTOP_STRING; | ||||
| static const char *S_KX_ACT_IPO_LOOPEND_STRING; | static const char *S_KX_ACT_IPO_LOOPEND_STRING; | ||||
| static const char *S_KX_ACT_IPO_KEY2KEY_STRING; | static const char *S_KX_ACT_IPO_KEY2KEY_STRING; | ||||
| static const char *S_KX_ACT_IPO_FROM_PROP_STRING; | static const char *S_KX_ACT_IPO_FROM_PROP_STRING; | ||||
| int string2mode(const char *modename); | int string2mode(const char *modename); | ||||
| int m_type; | int m_type; | ||||
| KX_IpoActuator(SCA_IObject* gameobj, | SCA_IpoActuator(SCA_IObject* gameobj, | ||||
| const STR_String& propname, | const STR_String& propname, | ||||
| const STR_String& framePropname, | const STR_String& framePropname, | ||||
| float starttime, | float starttime, | ||||
| float endtime, | float endtime, | ||||
| bool recurse, | bool recurse, | ||||
| int acttype, | int acttype, | ||||
| bool ipo_as_force, | bool ipo_as_force, | ||||
| bool ipo_add, | bool ipo_add, | ||||
| bool ipo_local); | bool ipo_local); | ||||
| virtual ~KX_IpoActuator() {}; | virtual ~SCA_IpoActuator() {} | ||||
| virtual CValue* GetReplica() { | virtual CValue* GetReplica() { | ||||
| KX_IpoActuator* replica = new KX_IpoActuator(*this);//m_float,GetName()); | SCA_IpoActuator* replica = new SCA_IpoActuator(*this);//m_float,GetName()); | ||||
| replica->ProcessReplica(); | replica->ProcessReplica(); | ||||
| return replica; | return replica; | ||||
| }; | } | ||||
| void SetStart(float starttime); | void SetStart(float starttime); | ||||
| void SetEnd(float endtime); | void SetEnd(float endtime); | ||||
| virtual bool Update(double curtime, bool frame); | virtual bool Update(double curtime, bool frame); | ||||
| /* --------------------------------------------------------------------- */ | /* --------------------------------------------------------------------- */ | ||||
| /* Python interface ---------------------------------------------------- */ | /* Python interface ---------------------------------------------------- */ | ||||
| /* --------------------------------------------------------------------- */ | /* --------------------------------------------------------------------- */ | ||||
| #ifdef WITH_PYTHON | |||||
| static PyObject* pyattr_get_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | |||||
| static int pyattr_set_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | |||||
| static PyObject* pyattr_get_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | |||||
| static int pyattr_set_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | |||||
| #endif | |||||
| }; | }; | ||||
| #endif /* __KX_IPOACTUATOR_H__ */ | #endif /* __SCA_IPOACTUATOR_H__ */ | ||||