Ocular Engine
Ocular::Core::ARoutine Class Reference

#include <ARoutine.hpp>

Inheritance diagram for Ocular::Core::ARoutine:
Ocular::Core::Object Ocular::Core::AEventListener Ocular::Core::ObjectIO Ocular::Core::Exposable Ocular::Core::Buildable Ocular::Core::FreeFlyController Ocular::Editor::AxisGizmoRoutine Ocular::Editor::EditorCameraController Ocular::Editor::InputLogger

Public Member Functions

 ARoutine (std::string const &name, std::string const &type)
bool operator< (ARoutine const &rhs)
bool operator> (ARoutine const &rhs)
virtual void onSceneStart ()
virtual void onSceneEnd ()
virtual void onCreation ()
virtual void onDestruction ()
virtual void onPause ()
virtual void onUnpause ()
virtual void onUpdate (float const delta)
virtual float onTimedUpdate ()
virtual void onPreRender ()
virtual void onPostRender ()
virtual bool onEvent (std::shared_ptr< AEvent > event)
Priority getPriorityLevel () const
SceneObjectgetParent () const
std::string const & getName () const
- Public Member Functions inherited from Ocular::Core::Object
 Object (std::string name, std::string className)
 Creates a new Object with the specified name and class. More...
 Object (std::string name)
 Creates a new Object with the specified name. More...
 Object ()
 Creates a new Object with the default name ('Name').
std::string const & getName () const
void setName (std::string name)
 Sets the name of the Object. More...
std::string const & getClass () const
void setUUID (std::string const &uuid)
UUID const & getUUID () const
int64_t getCreationTime () const
virtual std::string toString () const
template<class T >
bool isType ()
- Public Member Functions inherited from Ocular::Core::ObjectIO
virtual void onLoad (BuilderNode const *node) override
virtual void onSave (BuilderNode *node) const override
- Public Member Functions inherited from Ocular::Core::Exposable
void getAllExposedNames (std::vector< std::string > &names) const
bool getVariable (std::string const &name, ExposedVariable &var)
template<typename T >
bool getVariableValue (std::string const &name, T &var)
template<typename T >
bool setVariableValue (std::string const &name, T const &value)
virtual void onVariableModified (std::string const &varName)

Protected Member Functions

virtual void setParent (SceneObject *object)
void setName (std::string const &name)
- Protected Member Functions inherited from Ocular::Core::Exposable
void exposeVariable (std::string const &name, std::string const &type, bool isPointer, bool isExposed, void *data)

Protected Attributes

Priority m_Priority
 Priority level of this Routine in the Routine Queue.
 The SceneObject instance that this routine is attached to.
- Protected Attributes inherited from Ocular::Core::Object
std::string m_Name
std::string m_Class
const int64_t m_CreationTime
- Protected Attributes inherited from Ocular::Core::Exposable
std::unordered_map< std::string, ExposedVariablem_ExposedVariables


class SceneObject

Detailed Description

Event Called By
SceneStart TBD
SceneEnd During Scene destruction (Scene::~Scene)
Creation When routine is created (SceneObject::addRoutine)
Destruction When routine is destroyed (SceneObject::~SceneObject)
Pause TBD
Unpause TBD
Update During Scene update (Scene::update)
TimedUpdate TBD
PreRender TBD
PostRender TBD
Event TBD

Member Function Documentation

std::string const & Ocular::Core::ARoutine::getName ( ) const

Returns the non-unique name assigned to this Routine.

SceneObject * Ocular::Core::ARoutine::getParent ( ) const
The parent SceneObject that this Routine instance is attached to.
Priority Ocular::Core::ARoutine::getPriorityLevel ( ) const

The priority level of this Routine.

void Ocular::Core::ARoutine::onCreation ( )

Called when the parent SceneObject is added to the active Scene.

If this Routine is added after the SceneObject has already been created, then this method is called on Routine creation.

void Ocular::Core::ARoutine::onDestruction ( )

Called when the parent SceneObject is removed from the active Scene.

bool Ocular::Core::ARoutine::onEvent ( std::shared_ptr< AEvent event)

Called when an event occurs that the routine is registered as a listener for.

[in]eventPointer to the event
TRUE to keep processing this event after this listener, FALSE to consume this event

Implements Ocular::Core::AEventListener.

Reimplemented in Ocular::Core::FreeFlyController, and Ocular::Editor::InputLogger.

void Ocular::Core::ARoutine::onPause ( )

Called when the active Scene has been paused.

void Ocular::Core::ARoutine::onPostRender ( )

Called after the scene has been rendered.

void Ocular::Core::ARoutine::onPreRender ( )

Called prior to the rendering of the scene.

void Ocular::Core::ARoutine::onSceneEnd ( )

Called when the active Scene is ended. Note that this will typically only get called for Routines attached to persistent SceneObjects.

void Ocular::Core::ARoutine::onSceneStart ( )

Called when the active Scene is started. Note that this will typically only get called for Routines attached to peristent SceneObjects.

float Ocular::Core::ARoutine::onTimedUpdate ( )

An update called after a specified amount of time.

The return value is the amount of time, in seconds, that must elapse before this method is called again. This useful for logic that does not need to be run every frame, and instead can be run once a second or minute.

Returning a low value (approaching or below zero) will simply have this method behave identically to the standard onUpdate.

It should be noted that the returned time is only guaranteed to be a minimum amount of elapsed time. Depending on the framerate, it may take longer than the specified time to call the method again.

Minimum time to elapse (in seconds) before this method is called again.
void Ocular::Core::ARoutine::onUnpause ( )

Called when the active Scene has been unpaused.

void Ocular::Core::ARoutine::onUpdate ( float const  delta)

Called once per frame. Generally, Routines are updated in the order they are traversed in a Scene.

If a special circumstance requires that a Routine's update is called before or after other Routines, then the priority level can be adjusted.

[in]deltaCurrent delta time (time in seconds that the last frame took to complete).

Reimplemented in Ocular::Core::FreeFlyController, Ocular::Editor::EditorCameraController, and Ocular::Editor::AxisGizmoRoutine.

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