diff options
Diffstat (limited to 'source/gameengine/Ketsji/KX_IPO_SGController.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_IPO_SGController.h | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.h b/source/gameengine/Ketsji/KX_IPO_SGController.h index a010e8e3e6c..031b74294ce 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.h +++ b/source/gameengine/Ketsji/KX_IPO_SGController.h @@ -35,27 +35,49 @@ #include "KX_IPOTransform.h" #include "KX_IInterpolator.h" +#define KX_MAX_IPO_CHANNELS 19 //note- [0] is not used + class KX_IpoSGController : public SG_Controller { KX_IPOTransform m_ipo_xform; T_InterpolatorList m_interpolators; - /* Why not bools? */ - short m_modify_position : 1; - short m_modify_orientation : 1; - short m_modify_scaling : 1; + + /** Flag for each IPO channel that can be applied to a game object */ + bool m_ipo_channels_active[KX_MAX_IPO_CHANNELS]; /** Interpret the ipo as a force rather than a displacement? */ bool m_ipo_as_force; - /** Ipo-as-force acts in local rather than in global coordinates? */ - bool m_force_ipo_acts_local; + /** Add Ipo curve to current loc/rot/scale */ + bool m_ipo_add; + /** Ipo must be applied in local coordinate rather than in global coordinates (used for force and Add mode)*/ + bool m_ipo_local; + /** Were settings altered since the last update? */ bool m_modified; /** Local time of this ipo.*/ double m_ipotime; + /** Location of the object when the IPO is first fired (for local transformations) */ + class MT_Point3 m_ipo_start_point; + + /** Orientation of the object when the IPO is first fired (for local transformations) */ + class MT_Matrix3x3 m_ipo_start_orient; + + /** Scale of the object when the IPO is first fired (for local transformations) */ + class MT_Vector3 m_ipo_start_scale; + + /** if IPO initial position has been set for local normal IPO */ + bool m_ipo_start_initialized; + + /** Euler angles at the start of the game, needed for incomplete ROT Ipo curves */ + class MT_Vector3 m_ipo_start_euler; + + /** true is m_ipo_start_euler has been initialized */ + bool m_ipo_euler_initialized; + /** A reference to the original game object. */ class KX_GameObject* m_game_object; @@ -77,16 +99,12 @@ public: /** Set reference to the corresponding game object. */ void SetGameObject(class KX_GameObject*); - void SetModifyPosition(bool modifypos) { - m_modify_position=modifypos; - } - void SetModifyOrientation(bool modifyorient) { - m_modify_orientation=modifyorient; - } - void SetModifyScaling(bool modifyscale) { - m_modify_scaling=modifyscale; + void SetIPOChannelActive(int index, bool value) { + //indexes found in makesdna\DNA_ipo_types.h + m_ipo_channels_active[index] = value; } + KX_IPOTransform& GetIPOTransform() { return m_ipo_xform; @@ -102,3 +120,4 @@ public: #endif //__IPO_SGCONTROLLER_H + |