OSDN Git Service

Added OnEntry and OnExit functions to trigger object
authorryan <>
Tue, 3 Jan 2017 23:46:51 +0000 (23:46 +0000)
committerryan <>
Tue, 3 Jan 2017 23:46:51 +0000 (23:46 +0000)
src/sbs/trigger.cpp
src/sbs/trigger.h

index f753f3e..74ca2a2 100644 (file)
@@ -298,6 +298,11 @@ void Trigger::Loop()
                                Report("Outside trigger area '" + GetName() + "', parent '" + GetParent()->GetName() + "'");
                }
 
+               if (is_inside == true)
+                       OnEntry();
+               else
+                       OnExit();
+
                //get action name of next position state
                std::string name = GetPositionAction(GetNextSelectPosition());
 
index 58da9db..4e63623 100644 (file)
@@ -57,6 +57,8 @@ public:
        Ogre::Vector3 GetMin();
        Ogre::Vector3 GetMax();
        bool IsOutside(Ogre::Vector3 v1, Ogre::Vector3 v2);
+       virtual void OnEntry() {}
+       virtual void OnExit() {}
 
 private:
        Ogre::AxisAlignedBox *area_box;