xoreos  0.0.5
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Engines::Trigger Class Reference

#include <trigger.h>

Inheritance diagram for Engines::Trigger:
Inheritance graph
[legend]
Collaboration diagram for Engines::Trigger:
Collaboration graph
[legend]

Classes

struct  SlopeData
 

Public Member Functions

 Trigger ()
 
void setVisible (bool visible)
 
bool contains (float x, float y) const
 
void calculateDistance ()
 Calculate the object's distance. More...
 
void render (Graphics::RenderPass pass)
 Render the object. More...
 
- Public Member Functions inherited from Graphics::Renderable
 Renderable (RenderableType type)
 
 ~Renderable ()
 
bool operator< (const Queueable &q) const
 
virtual void advanceTime (float dt)
 Advance time (used by renderables with animations). More...
 
virtual void renderImmediate (const glm::mat4 &parentTransform)
 For shader based systems, don't sort anything, render this right_now. More...
 
virtual void queueRender (const glm::mat4 &parentTransform)
 Queue the object for later rendering. More...
 
double getDistance () const
 Get the distance of the object from the viewer. More...
 
uint32 getID () const
 Get the object's unique ID. More...
 
bool isClickable () const
 Is the object clickable? More...
 
void setClickable (bool clickable)
 Set the object's clickable state. More...
 
const Common::UStringgetTag () const
 Get the object's tag. More...
 
void setTag (const Common::UString &tag)
 Set the object's tag. More...
 
bool isVisible () const
 Is the object visible? More...
 
virtual void show ()
 Show the object. More...
 
virtual void hide ()
 Hide the object. More...
 
virtual bool isIn (float x, float y) const
 Is that point within the object? More...
 
virtual bool isIn (float x, float y, float z) const
 Is that point within the object? More...
 
virtual bool isIn (float x1, float y1, float z1, float x2, float y2, float z2) const
 Does the line from x1.y1.z1 to x2.y2.z2 intersect with the object? More...
 
- Public Member Functions inherited from Graphics::Queueable
 Queueable ()
 
virtual ~Queueable ()
 

Protected Member Functions

void prepare ()
 
- Protected Member Functions inherited from Graphics::Renderable
void resort ()
 
void lockFrame ()
 
void unlockFrame ()
 
void lockFrameIfVisible ()
 
void unlockFrameIfVisible ()
 
- Protected Member Functions inherited from Graphics::Queueable
bool isInQueue (QueueType queue) const
 
void addToQueue (QueueType queue)
 
void removeFromQueue (QueueType queue)
 
void lockQueue (QueueType queue)
 
void unlockQueue (QueueType queue)
 
void sortQueue (QueueType queue)
 

Protected Attributes

std::vector< glm::vec3 > _geometry
 
bool _visible
 
- Protected Attributes inherited from Graphics::Renderable
QueueType _queueExists
 
QueueType _queueVisible
 
uint32 _id
 
bool _clickable
 
Common::UString _tag
 
double _distance
 The distance of the object from the viewer. More...
 

Private Member Functions

bool isRayIntersect (float x, float y, float x1, float y1, float x2, float y2, float m, bool isVert) const
 

Private Attributes

bool _prepared
 
Common::BoundingBox _boundingbox
 
std::vector< SlopeData_sides
 

Detailed Description

Definition at line 38 of file trigger.h.

Constructor & Destructor Documentation

◆ Trigger()

Engines::Trigger::Trigger ( )

Definition at line 37 of file trigger.cpp.

Member Function Documentation

◆ calculateDistance()

void Engines::Trigger::calculateDistance ( )
virtual

Calculate the object's distance.

Implements Graphics::Renderable.

Definition at line 87 of file trigger.cpp.

◆ contains()

bool Engines::Trigger::contains ( float  x,
float  y 
) const

Definition at line 51 of file trigger.cpp.

References _boundingbox, _geometry, _prepared, _sides, Common::BoundingBox::isIn(), and isRayIntersect().

Referenced by Engines::KotOR2::Area::evaluateTriggers(), and Engines::KotOR::Area::evaluateTriggers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isRayIntersect()

bool Engines::Trigger::isRayIntersect ( float  x,
float  y,
float  x1,
float  y1,
float  x2,
float  y2,
float  m,
bool  isVert 
) const
private

Definition at line 162 of file trigger.cpp.

References kEpsilon.

Referenced by contains().

Here is the caller graph for this function:

◆ prepare()

void Engines::Trigger::prepare ( )
protected

Definition at line 117 of file trigger.cpp.

References _boundingbox, _geometry, _prepared, _sides, Common::BoundingBox::add(), Engines::Trigger::SlopeData::isVert, kEpsilon, and Engines::Trigger::SlopeData::m.

Referenced by Engines::KotOR::Trigger::Trigger(), and Engines::KotOR2::Trigger::Trigger().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render()

void Engines::Trigger::render ( Graphics::RenderPass  pass)
virtual

Render the object.

Implements Graphics::Renderable.

Definition at line 91 of file trigger.cpp.

References _geometry, _visible, Graphics::kRenderPassTransparent, and pass.

◆ setVisible()

void Engines::Trigger::setVisible ( bool  visible)

Definition at line 43 of file trigger.cpp.

References _visible.

Member Data Documentation

◆ _boundingbox

Common::BoundingBox Engines::Trigger::_boundingbox
private

Definition at line 61 of file trigger.h.

Referenced by contains(), and prepare().

◆ _geometry

std::vector<glm::vec3> Engines::Trigger::_geometry
protected

◆ _prepared

bool Engines::Trigger::_prepared
private

Definition at line 60 of file trigger.h.

Referenced by contains(), and prepare().

◆ _sides

std::vector<SlopeData> Engines::Trigger::_sides
private

Definition at line 62 of file trigger.h.

Referenced by contains(), and prepare().

◆ _visible

bool Engines::Trigger::_visible
protected

Definition at line 51 of file trigger.h.

Referenced by render(), and setVisible().


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