8 #ifndef META_OCEAN_INTERACTION_EXPERIENCES_EXPERIENCES_LIBRARY_H
9 #define META_OCEAN_INTERACTION_EXPERIENCES_EXPERIENCES_LIBRARY_H
Internal helper class holding the instance of this library.
Definition: ExperiencesLibrary.h:53
Lock & lock()
Returns the lock.
Instance()
Creates a new object with invalid instance.
ExperiencesLibrary *& experiencesLibrary()
Returns the pointer to the instance of the experience library.
Lock lock_
Lock to make this class thread safe.
Definition: ExperiencesLibrary.h:83
This class implements the experiences interaction library object.
Definition: ExperiencesLibrary.h:34
std::function< UniqueExperience()> CreateExperienceFunction
Definition of a callback function allowing to create a new experience.
Definition: ExperiencesLibrary.h:45
static bool registerNewExperience(std::string experienceName, CreateExperienceFunction createExperienceFunction)
Registers a new experience without actually creating the experience.
bool load(const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp, const std::string &filename) override
Loads a new interaction file.
static bool unregisterLibrary()
Unregisters this library at the global interaction manager.
~ExperiencesLibrary() override
Destructs a experiences library object.
void onMouseMove(const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &button, const Vector2 &screenPosition, const Line3 &ray, const Rendering::ObjectId pickedObject, const Vector3 &pickedPosition, const Timestamp timestamp) override
Mouse move event function.
std::unique_ptr< Experience > UniqueExperience
Definition of a unique pointer to an Experience object.
Definition: ExperiencesLibrary.h:40
void unload(const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp) override
Unloads all loaded scripts.
void postUpdate(const UserInterface &userInterface, const Rendering::EngineRef &engine, const Rendering::ViewRef &view, const Timestamp timestamp) override
Post update interaction function.
void release() override
Releases this library.
bool unload(const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp, const std::string &filename) override
Unloads one specific loaded interaction files.
void onKeyRelease(const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &key, const Timestamp timestamp) override
Key release function.
Lock lock_
The library's lock.
Definition: ExperiencesLibrary.h:223
std::unordered_map< std::string, CreateExperienceFunction > NameToFunctionMap
Definition of an unordered map mapping experience names to experience create functions.
Definition: ExperiencesLibrary.h:94
void onMouseRelease(const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &button, const Vector2 &screenPosition, const Line3 &ray, const Rendering::ObjectId pickedObject, const Vector3 &pickedPosition, const Timestamp timestamp) override
Mouse release event function.
void postFileLoad(const UserInterface &userInterface, const std::string &filename, const bool succeeded) override
Post file load interaction function.
void onMousePress(const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &button, const Vector2 &screenPosition, const Line3 &ray, const Rendering::ObjectId pickedObject, const Vector3 &pickedPosition, const Timestamp timestamp) override
Mouse press event function.
ExperiencesLibrary()
Creates a new experiences library object.
std::unordered_map< std::string, UniqueExperience > NameToExperienceMap
Definition of a vector holding experiences.
Definition: ExperiencesLibrary.h:89
static void registerLibrary()
Creates this library and registers it at the global interaction manager.
Timestamp preUpdate(const UserInterface &userInterface, const Rendering::EngineRef &engine, const Rendering::ViewRef &view, const Timestamp timestamp) override
Pre update interaction function.
NameToFunctionMap nameToFunctionMap_
The map mapping names of experiences to create functions.
Definition: ExperiencesLibrary.h:217
void onKeyPress(const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &key, const Timestamp timestamp) override
Key press function.
void preFileLoad(const UserInterface &userInterface, const std::string &filename) override
Pre file load interaction function.
NameToExperienceMap nameToExperienceMap_
The map mapping names of experiences to actual instances of experiences.
Definition: ExperiencesLibrary.h:220
This class implements the base class for all interaction libraries.
Definition: interaction/Library.h:29
This class holds UI elements of the application from which the interaction is executed.
Definition: UserInterface.h:28
This class implements an infinite line in 3D space.
Definition: Line3.h:70
This class implements a recursive lock object.
Definition: Lock.h:31
This template class is the base class for all singleton objects.
Definition: Singleton.h:71
This class implements a timestamp.
Definition: Timestamp.h:36
size_t ObjectId
Definition of a object id.
Definition: rendering/Rendering.h:59
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15