8#ifndef META_OCEAN_INTERACTION_EXPERIENCES_EXPERIENCES_LIBRARY_H
9#define META_OCEAN_INTERACTION_EXPERIENCES_EXPERIENCES_LIBRARY_H
Instance()
Creates a new object with invalid instance.
Lock lock_
Lock to make this class thread safe.
Definition ExperiencesLibrary.h:83
ExperiencesLibrary *& experiencesLibrary()
Returns the pointer to the instance of the experience library.
Lock & lock()
Returns the lock.
ExperiencesLibrary * experiencesLibrary_
The pointer to the instance of the experience library.
Definition ExperiencesLibrary.h:80
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::unordered_map< std::string, UniqueExperience > NameToExperienceMap
Definition of a vector holding experiences.
Definition ExperiencesLibrary.h:89
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.
std::unique_ptr< Experience > UniqueExperience
Definition of a unique pointer to an Experience object.
Definition ExperiencesLibrary.h:40
void onKeyRelease(const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &key, const Timestamp timestamp) override
Key release function.
std::unordered_map< std::string, CreateExperienceFunction > NameToFunctionMap
Definition of an unordered map mapping experience names to experience create functions.
Definition ExperiencesLibrary.h:94
Lock lock_
The library's lock.
Definition ExperiencesLibrary.h:223
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.
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.
std::function< UniqueExperience()> CreateExperienceFunction
Definition of a callback function allowing to create a new experience.
Definition ExperiencesLibrary.h:45
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
Library(const std::string &name)
Creates a new library object.
This class holds UI elements of the application from which the interaction is executed.
Definition UserInterface.h:28
This class implements a recursive lock object.
Definition Lock.h:31
This class implements a timestamp.
Definition Timestamp.h:64
VectorT2< Scalar > Vector2
Definition of a 2D vector.
Definition Vector2.h:28
VectorT3< Scalar > Vector3
Definition of a 3D vector.
Definition Vector3.h:29
LineT3< Scalar > Line3
Definition of the Line3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single o...
Definition Line3.h:27
Ocean::ObjectRef< Engine > EngineRef
Definition of an engine reference object.
Definition Engine.h:30
size_t ObjectId
Definition of a object id.
Definition rendering/Rendering.h:59
SmartObjectRef< View > ViewRef
Definition of a smart object reference holding a view node.
Definition View.h:39
Namespace of the Interaction Experiences library.
Definition AnchoredContentManager.h:32
Namespace of the Interaction library.
Definition Empty.h:19
The namespace covering the entire Ocean framework.
Definition Accessor.h:15