Skyscraper 2.0
SBS::Trigger Class Reference

#include <trigger.h>

Inheritance diagram for SBS::Trigger:
Collaboration diagram for SBS::Trigger:

Public Member Functions

 Trigger (Object *parent, const std::string &name, bool permanent, const std::string &sound_file, Vector3 area_min, Vector3 area_max, const std::vector< std::string > &action_names)
 
 ~Trigger ()
 
void Enabled (bool value)
 
bool SetSelectPosition (int position)
 
bool ChangeSelectPosition (int position)
 
bool NextSelectPosition (bool check_state=true)
 
bool PreviousSelectPosition (bool check_state=true)
 
int GetSelectPosition ()
 
std::string GetPositionAction (int position)
 
std::string GetSelectPositionAction ()
 
int GetNextSelectPosition ()
 
int GetPreviousSelectPosition ()
 
int GetPositions ()
 
void PlaySound ()
 
int FindActionPosition (const std::string &name)
 
bool DoAction ()
 
void Loop ()
 
bool IsInside ()
 
bool IsInside (const Vector3 &position)
 
bool IsEnabled ()
 
Ogre::AxisAlignedBox GetBounds (bool relative=false)
 
Vector3 GetMin ()
 
Vector3 GetMax ()
 
bool IsOutside (Vector3 v1, Vector3 v2)
 
virtual void OnEntry ()
 
virtual void OnExit ()
 
- Public Member Functions inherited from SBS::Object
 Object (Object *parent)
 
virtual ~Object ()
 
void SetValues (const std::string &type, const std::string &name, bool is_permanent, bool is_movable=true)
 
bool IsPermanent ()
 
bool IsMovable ()
 
const std::string & GetType ()
 
int GetNumber ()
 
void AddChild (Object *object)
 
ObjectGetChild (int index)
 
int GetChildrenCount ()
 
void RemoveChild (Object *object)
 
SceneNodeGetSceneNode ()
 
void ShowBoundingBox (bool value)
 
virtual void Move (const Vector3 &vector, Real speed=1.0)
 
virtual void Move (Real X, Real Y, Real Z, Real speed=1.0)
 
virtual void SetPosition (const Vector3 &position)
 
void SetPositionRelative (const Vector3 &position)
 
virtual void SetPosition (Real X, Real Y, Real Z)
 
void SetPositionRelative (Real X, Real Y, Real Z)
 
virtual void SetPositionY (Real value)
 
virtual Vector3 GetPosition (bool relative=false)
 
virtual void Rotate (const Vector3 &vector, Real speed=1.0)
 
virtual void Rotate (Real X, Real Y, Real Z, Real speed=1.0)
 
virtual void SetRotation (const Vector3 &rotation)
 
virtual void SetRotation (Real X, Real Y, Real Z)
 
virtual Vector3 GetRotation ()
 
Quaternion GetOrientation (bool relative=false)
 
void SetOrientation (const Quaternion &q, bool relative=false)
 
virtual void OnMove (bool parent)
 
virtual void OnRotate (bool parent)
 
virtual void OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right)
 
virtual void OnUnclick (bool right)
 
virtual void OnHit ()
 
void NotifyMove (bool parent=false)
 
void NotifyRotate (bool parent=false)
 
virtual void ResetState ()
 
void ChangeParent (Object *new_parent)
 
bool IsGlobal ()
 
void Init (bool children=true)
 
virtual void OnInit ()
 
void RegisterLoop (Object *object)
 
void UnregisterLoop (Object *object)
 
std::string GetNameBase ()
 
template<typename T >
bool IsType ()
 
template<typename T >
T * ConvertTo ()
 
- Public Member Functions inherited from SBS::ObjectBase
 ObjectBase (Object *parent)
 
virtual ~ObjectBase ()
 
ObjectGetParent ()
 
SBSGetRoot ()
 
void SetName (const std::string &name)
 
const std::string & GetName ()
 
std::string GetNameBase ()
 
virtual void Report (const std::string &message)
 
virtual bool ReportError (const std::string &message)
 

Private Attributes

Ogre::AxisAlignedBox * area_box
 
int current_position
 
bool is_inside
 
bool is_enabled
 
std::vector< std::string > Actions
 
Soundsound
 

Additional Inherited Members

- Public Attributes inherited from SBS::Object
std::string command
 
std::string command_processed
 
std::string context
 
int linenum
 
std::string includefile
 
bool parent_deleting
 
- Protected Member Functions inherited from SBS::Object
void EnableLoop (bool value)
 
void LoopChildren ()
 
bool SelfDestruct ()
 
- Protected Attributes inherited from SBS::ObjectBase
SBSsbs
 

Detailed Description

Definition at line 29 of file trigger.h.

Constructor & Destructor Documentation

◆ Trigger()

SBS::Trigger::Trigger ( Object * parent,
const std::string & name,
bool permanent,
const std::string & sound_file,
Vector3 area_min,
Vector3 area_max,
const std::vector< std::string > & action_names )

Definition at line 39 of file trigger.cpp.

References Actions, area_box, current_position, SBS::Object::EnableLoop(), is_enabled, is_inside, SBS::Sound::Load(), SBS::Object::SetValues(), and sound.

Here is the call graph for this function:

◆ ~Trigger()

SBS::Trigger::~Trigger ( )

Member Function Documentation

◆ ChangeSelectPosition()

bool SBS::Trigger::ChangeSelectPosition ( int position)

Definition at line 125 of file trigger.cpp.

References current_position, and SetSelectPosition().

Referenced by NextSelectPosition(), and PreviousSelectPosition().

Here is the call graph for this function:

◆ DoAction()

bool SBS::Trigger::DoAction ( )

Definition at line 241 of file trigger.cpp.

References Actions, current_position, SBS::SBS::GetAction(), SBS::ObjectBase::GetName(), SBS::ObjectBase::ReportError(), and SBS::ObjectBase::sbs.

Referenced by Loop().

Here is the call graph for this function:

◆ Enabled()

void SBS::Trigger::Enabled ( bool value)
virtual

Reimplemented from SBS::Object.

Definition at line 102 of file trigger.cpp.

References SBS::Object::EnableLoop(), and is_enabled.

Here is the call graph for this function:

◆ FindActionPosition()

int SBS::Trigger::FindActionPosition ( const std::string & name)

Definition at line 227 of file trigger.cpp.

References GetPositionAction(), and GetPositions().

Here is the call graph for this function:

◆ GetBounds()

Ogre::AxisAlignedBox SBS::Trigger::GetBounds ( bool relative = false)

Definition at line 344 of file trigger.cpp.

References area_box, and SBS::Object::GetPosition().

Here is the call graph for this function:

◆ GetMax()

Vector3 SBS::Trigger::GetMax ( )

Definition at line 384 of file trigger.cpp.

References area_box.

◆ GetMin()

Vector3 SBS::Trigger::GetMin ( )

Definition at line 379 of file trigger.cpp.

References area_box.

◆ GetNextSelectPosition()

int SBS::Trigger::GetNextSelectPosition ( )

Definition at line 147 of file trigger.cpp.

References current_position, and GetPositions().

Referenced by Loop(), and NextSelectPosition().

Here is the call graph for this function:

◆ GetPositionAction()

std::string SBS::Trigger::GetPositionAction ( int position)

Definition at line 196 of file trigger.cpp.

References Actions, SBS::SBS::GetAction(), and SBS::ObjectBase::sbs.

Referenced by FindActionPosition(), GetSelectPositionAction(), and Loop().

Here is the call graph for this function:

◆ GetPositions()

int SBS::Trigger::GetPositions ( )

◆ GetPreviousSelectPosition()

int SBS::Trigger::GetPreviousSelectPosition ( )

Definition at line 169 of file trigger.cpp.

References current_position, and GetPositions().

Referenced by PreviousSelectPosition().

Here is the call graph for this function:

◆ GetSelectPosition()

int SBS::Trigger::GetSelectPosition ( )

Definition at line 190 of file trigger.cpp.

References current_position.

◆ GetSelectPositionAction()

std::string SBS::Trigger::GetSelectPositionAction ( )

Definition at line 215 of file trigger.cpp.

References current_position, and GetPositionAction().

Referenced by Loop().

Here is the call graph for this function:

◆ IsEnabled()

bool SBS::Trigger::IsEnabled ( )
inline

Definition at line 53 of file trigger.h.

◆ IsInside() [1/2]

bool SBS::Trigger::IsInside ( )

Definition at line 330 of file trigger.cpp.

References is_inside.

Referenced by SBS::ElevatorDoor::IsSensorBlocked(), and Loop().

◆ IsInside() [2/2]

bool SBS::Trigger::IsInside ( const Vector3 & position)

Definition at line 337 of file trigger.cpp.

References area_box, and SBS::Object::GetPosition().

Here is the call graph for this function:

◆ IsOutside()

bool SBS::Trigger::IsOutside ( Vector3 v1,
Vector3 v2 )

Definition at line 360 of file trigger.cpp.

References area_box, and SBS::Object::GetPosition().

Here is the call graph for this function:

◆ Loop()

◆ NextSelectPosition()

bool SBS::Trigger::NextSelectPosition ( bool check_state = true)

Definition at line 135 of file trigger.cpp.

References ChangeSelectPosition(), GetNextSelectPosition(), and SetSelectPosition().

Referenced by Loop().

Here is the call graph for this function:

◆ OnEntry()

virtual void SBS::Trigger::OnEntry ( )
inlinevirtual

Definition at line 58 of file trigger.h.

Referenced by Loop().

◆ OnExit()

virtual void SBS::Trigger::OnExit ( )
inlinevirtual

Definition at line 59 of file trigger.h.

Referenced by Loop().

◆ PlaySound()

void SBS::Trigger::PlaySound ( )

Definition at line 179 of file trigger.cpp.

References SBS::Sound::Play(), SBS::Sound::SetLoopState(), and sound.

Referenced by Loop().

Here is the call graph for this function:

◆ PreviousSelectPosition()

bool SBS::Trigger::PreviousSelectPosition ( bool check_state = true)

Definition at line 157 of file trigger.cpp.

References ChangeSelectPosition(), GetPreviousSelectPosition(), and SetSelectPosition().

Referenced by Loop().

Here is the call graph for this function:

◆ SetSelectPosition()

bool SBS::Trigger::SetSelectPosition ( int position)

Definition at line 113 of file trigger.cpp.

References current_position, and GetPositions().

Referenced by ChangeSelectPosition(), NextSelectPosition(), and PreviousSelectPosition().

Here is the call graph for this function:

Member Data Documentation

◆ Actions

std::vector<std::string> SBS::Trigger::Actions
private

Definition at line 66 of file trigger.h.

Referenced by DoAction(), GetPositionAction(), GetPositions(), and Trigger().

◆ area_box

Ogre::AxisAlignedBox* SBS::Trigger::area_box
private

Definition at line 62 of file trigger.h.

Referenced by GetBounds(), GetMax(), GetMin(), IsInside(), IsOutside(), Trigger(), and ~Trigger().

◆ current_position

◆ is_enabled

bool SBS::Trigger::is_enabled
private

Definition at line 65 of file trigger.h.

Referenced by Enabled(), Loop(), and Trigger().

◆ is_inside

bool SBS::Trigger::is_inside
private

Definition at line 64 of file trigger.h.

Referenced by IsInside(), Loop(), and Trigger().

◆ sound

Sound* SBS::Trigger::sound
private

Definition at line 68 of file trigger.h.

Referenced by PlaySound(), Trigger(), and ~Trigger().


The documentation for this class was generated from the following files: