75 void SetPoints(
const Ogre::Vector3& point1,
const Ogre::Vector3& point2);
An entity trigger.
Definition: EntityTrigger.h:25
bool enabled_
Indicates if the trigger is enabled or disabled.
Definition: EntityTrigger.h:207
bool IsEnabled() const
Checks if the trigger is enabled.
Definition: EntityTrigger.cpp:63
bool approached_
Indicates if the playable entity has approached the line.
Definition: EntityTrigger.h:233
void ClearNearEventCooldown()
Sets the cooldown time required between calls to on_near event to 0.
Definition: EntityTrigger.cpp:98
const bool CheckApproached()
Check if the line has been approached.
Definition: EntityTrigger.cpp:76
const Ogre::Vector3 & GetPoint2() const
Retrieves the second vertex of the line that acts as trigger.
Definition: EntityTrigger.cpp:74
void DecreaseNearEventCooldown()
Decreases the cooldown time required between calls to on_near event by one.
Definition: EntityTrigger.cpp:92
const Ogre::String & GetName() const
Retrieves the trigger name.
Definition: EntityTrigger.cpp:56
Ogre::Vector3 point_1_
One of the vertices of the trigger line.
Definition: EntityTrigger.h:212
static int NEAR_EVENT_COOLDOWN_FRAMES
Frames to cooldown after triggering on_near event.
Definition: EntityTrigger.h:228
void UpdateDebug()
Updates the trigger state with debug information.
Definition: EntityTrigger.cpp:40
const bool CheckCrossed()
Check if the line has been crossed.
Definition: EntityTrigger.cpp:80
bool crossed_
Indicates if the playable entity has crossed the line.
Definition: EntityTrigger.h:238
void SetEnabled(const bool enabled)
Enables or disables the trigger.
Definition: EntityTrigger.cpp:58
void SetNearSingleEventTriggered(const bool triggered)
Sets if the on_near_once have been triggered.
Definition: EntityTrigger.cpp:86
const int GetNearEventCooldown()
Checks if the cooldown that prevents caling the on_near event multiple times has ended.
Definition: EntityTrigger.cpp:90
void SetCrossed(const bool crossed)
Sets if the the playable entity has crossed the line.
Definition: EntityTrigger.cpp:82
void ResetNearEventCooldown()
Resets the cooldown time required between calls to on_near event.
Definition: EntityTrigger.cpp:96
const bool CheckNearSingleEventTriggered()
Checks if the on_near_once event has been fired.
Definition: EntityTrigger.cpp:84
const Ogre::Vector3 & GetPoint1() const
Retrieves the first vertex of the line that acts as trigger.
Definition: EntityTrigger.cpp:72
EntityTrigger(const Ogre::String &name)
Constructor.
Definition: EntityTrigger.cpp:27
virtual ~EntityTrigger()
Destructor.
Definition: EntityTrigger.cpp:38
Ogre::Vector3 point_2_
One of the vertices of the trigger line.
Definition: EntityTrigger.h:217
void SetPoints(const Ogre::Vector3 &point1, const Ogre::Vector3 &point2)
Sets the vertices of the line that acts as the trigger.
Definition: EntityTrigger.cpp:65
void Clear()
Clears the proximity statuses and event triggering statuses.
Definition: EntityTrigger.cpp:100
void SetApproached(const bool approached)
Sets if the the playable entity has approached the line.
Definition: EntityTrigger.cpp:78
Ogre::String name_
The name of the trigger.
Definition: EntityTrigger.h:202
bool near_single_event_triggered_
Indicates if the near_once event has been triggered.
Definition: EntityTrigger.h:243
int near_event_cooldown_
Remaining frames to cooldown after triggering on_near event.
Definition: EntityTrigger.h:252
Any entity in a field.
Definition: Entity.h:101
Ogre::String String
Definition: TypeDefine.h:37