Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/GameLogic/SCA_ShapeActionActuator.h
- This file was moved from source/gameengine/Converter/BL_ShapeActionActuator.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 BL_ShapeActionActuator.h | /** \file SCA_ShapeActionActuator.h | ||||
| * \ingroup bgeconv | * \ingroup gamelogic | ||||
| */ | */ | ||||
| #ifndef __BL_SHAPEACTIONACTUATOR_H__ | #ifndef __SCA_SHAPEACTIONACTUATOR_H__ | ||||
| #define __BL_SHAPEACTIONACTUATOR_H__ | #define __SCA_SHAPEACTIONACTUATOR_H__ | ||||
| #include "CTR_HashedPtr.h" | #include "CTR_HashedPtr.h" | ||||
| #include "SCA_IActuator.h" | #include "SCA_IActuator.h" | ||||
| #include "BL_ActionActuator.h" | #include "SCA_ActionActuator.h" | ||||
| #include "MT_Point3.h" | #include "MT_Point3.h" | ||||
| #include <vector> | #include <vector> | ||||
| struct Key; | struct Key; | ||||
| class BL_ShapeActionActuator : public SCA_IActuator | class SCA_ShapeActionActuator : public SCA_IActuator | ||||
| { | { | ||||
| public: | public: | ||||
| Py_Header | Py_Header | ||||
| BL_ShapeActionActuator(SCA_IObject* gameobj, | SCA_ShapeActionActuator(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, | ||||
| struct bAction *action, | struct bAction *action, | ||||
| short playtype, | short playtype, | ||||
| short blendin, | short blendin, | ||||
| short priority, | short priority, | ||||
| float stride); | float stride); | ||||
| virtual ~BL_ShapeActionActuator(); | virtual ~SCA_ShapeActionActuator(); | ||||
| virtual bool Update(double curtime, bool frame); | virtual bool Update(double curtime, bool frame); | ||||
| virtual CValue* GetReplica(); | virtual CValue* GetReplica(); | ||||
| virtual void ProcessReplica(); | virtual void ProcessReplica(); | ||||
| void SetBlendTime (float newtime); | void SetBlendTime (float newtime); | ||||
| void BlendShape(struct Key* key, float weigth); | void BlendShape(struct Key* key, float weigth); | ||||
| bAction* GetAction() { return m_action; } | bAction* GetAction() { return m_action; } | ||||
| void SetAction(bAction* act) { m_action= act; } | void SetAction(bAction* act) { m_action= act; } | ||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||
| static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | ||||
| static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | ||||
| static int CheckBlendTime(void *self, const PyAttributeDef*) | static int CheckBlendTime(void *self, const PyAttributeDef*) | ||||
| { | { | ||||
| BL_ShapeActionActuator* act = reinterpret_cast<BL_ShapeActionActuator*>(self); | SCA_ShapeActionActuator* act = reinterpret_cast<SCA_ShapeActionActuator*>(self); | ||||
| if (act->m_blendframe > act->m_blendin) | if (act->m_blendframe > act->m_blendin) | ||||
| act->m_blendframe = act->m_blendin; | act->m_blendframe = act->m_blendin; | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| static int CheckFrame(void *self, const PyAttributeDef*) | static int CheckFrame(void *self, const PyAttributeDef*) | ||||
| { | { | ||||
| BL_ShapeActionActuator* act = reinterpret_cast<BL_ShapeActionActuator*>(self); | SCA_ShapeActionActuator* act = reinterpret_cast<SCA_ShapeActionActuator*>(self); | ||||
| if (act->m_localtime < act->m_startframe) | if (act->m_localtime < act->m_startframe) | ||||
| act->m_localtime = act->m_startframe; | act->m_localtime = act->m_startframe; | ||||
| else if (act->m_localtime > act->m_endframe) | else if (act->m_localtime > act->m_endframe) | ||||
| act->m_localtime = act->m_endframe; | act->m_localtime = act->m_endframe; | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| static int CheckType(void *self, const PyAttributeDef*) | static int CheckType(void *self, const PyAttributeDef*) | ||||
| { | { | ||||
| BL_ShapeActionActuator* act = reinterpret_cast<BL_ShapeActionActuator*>(self); | SCA_ShapeActionActuator* act = reinterpret_cast<SCA_ShapeActionActuator*>(self); | ||||
| switch (act->m_playtype) { | switch (act->m_playtype) { | ||||
| case ACT_ACTION_PLAY: | case ACT_ACTION_PLAY: | ||||
| case ACT_ACTION_PINGPONG: | case ACT_ACTION_PINGPONG: | ||||
| case ACT_ACTION_FLIPPER: | case ACT_ACTION_FLIPPER: | ||||
| case ACT_ACTION_LOOP_STOP: | case ACT_ACTION_LOOP_STOP: | ||||
| case ACT_ACTION_LOOP_END: | case ACT_ACTION_LOOP_END: | ||||
| case ACT_ACTION_FROM_PROP: | case ACT_ACTION_FROM_PROP: | ||||
| Show All 33 Lines | protected: | ||||
| short m_priority; | short m_priority; | ||||
| struct bAction *m_action; | struct bAction *m_action; | ||||
| STR_String m_framepropname; | STR_String m_framepropname; | ||||
| STR_String m_propname; | STR_String m_propname; | ||||
| vector<float> m_blendshape; | vector<float> m_blendshape; | ||||
| struct PointerRNA *m_idptr; | struct PointerRNA *m_idptr; | ||||
| }; | }; | ||||
| #endif /* __BL_SHAPEACTIONACTUATOR_H__ */ | #endif /* __SCA_SHAPEACTIONACTUATOR_H__ */ | ||||