Drag[en]gine Game Engine
1.21
|
VR system. More...
#include <deVRSystem.h>
Public Member Functions | |
Constructors and Destructors | |
deVRSystem (deEngine *engine) | |
Create vr system. More... | |
virtual | ~deVRSystem () |
Clean up vr system. More... | |
Management | |
deBaseVRModule * | GetActiveModule () const |
Active module or nullptr if none is active. More... | |
deInputEventQueue & | GetEventQueue () |
VR queue. More... | |
const deInputEventQueue & | GetEventQueue () const |
void | ProcessEvents () |
Add events to the VR System event queue. More... | |
bool | RuntimeUsable () |
VR Runtime is usable. More... | |
void | RequestFeatureEyeGazeTracking (deBaseVRModule::eFeatureSupportLevel level) |
Set feature request level for eye gaze tracking. More... | |
void | RequestFeatureFacialTracking (deBaseVRModule::eFeatureSupportLevel level) |
Set feature request level for facial tracking. More... | |
void | StartRuntime () |
Start VR. More... | |
void | StopRuntime () |
Stop VR. More... | |
deCamera * | GetCamera () const |
Camera to render on head mounted display or nullptr. More... | |
void | SetCamera (deCamera *camera) |
Set camera to render on head mounted display. More... | |
bool | SupportsPassthrough () |
VR Runtime supports presenting user environment inside the rendered world. More... | |
bool | GetEnablePassthrough () const |
Presenting user environment inside the rendered world is enabled. More... | |
void | SetEnablePassthrough (bool enable) |
Enable presenting user environment inside the rendered world. More... | |
float | GetPassthroughTransparency () const |
Transparency of user environment presented inside the rendered world. More... | |
void | SetPassthroughTransparency (float transparency) |
Set transparency of user environment presented inside the rendered world. More... | |
Overloadables | |
virtual void | SetActiveModule (deLoadableModule *module) |
Set active loadable module. More... | |
virtual void | ClearPermanents () |
Clearcross references and links that could lead to memory leaks. More... | |
virtual void | PostStart () |
Carry out here actions right after the system started up. More... | |
virtual void | PreStop () |
Carry out here actions right before the system shuts down. More... | |
Public Member Functions inherited from deBaseSystem | |
deBaseSystem (deEngine *engine, const char *systemName, int requiredModuleType) | |
Create new base system linked to the given engine. More... | |
virtual | ~deBaseSystem () |
Clean up base system. More... | |
deEngine * | GetEngine () const |
Linked game engine. More... | |
deLoadableModule * | GetActiveLoadableModule () const |
Active loadable module. More... | |
bool | GetIsRunning () const |
System is running. More... | |
bool | GetHasFailed () const |
System has failed during runtime. More... | |
const decString & | GetSystemName () const |
System name. More... | |
virtual bool | CanStart () |
void | SetHasFailed (bool hasFailed) |
Set if system has failed. More... | |
virtual void | Start () |
Start system and the active loadable module. More... | |
virtual void | Stop () |
Stop system and the active loadable module. More... | |
void | CheckAndActivateFirst (deModuleSystem::eModuleTypes type) |
Check if at least one module is working and select the first one. More... | |
void | LogInfo (const char *message) |
Output information message on the console. More... | |
void | LogInfoFormat (const char *message,...) |
Output formated information message on the console. More... | |
void | LogInfoFormatUsing (const char *message, va_list args) |
Output formated information message on the console. More... | |
void | LogWarn (const char *message) |
Output warning message on the console. More... | |
void | LogWarnFormat (const char *message,...) |
Output formated warning message on the console. More... | |
void | LogWarnFormatUsing (const char *message, va_list args) |
Output formated warning message on the console. More... | |
void | LogError (const char *message) |
Output error message on the console. More... | |
void | LogErrorFormat (const char *message,...) |
Output formated error message on the console. More... | |
void | LogErrorFormatUsing (const char *message, va_list args) |
Output formated error message on the console. More... | |
void | LogException (const deException &exception) |
Output exception as error message on the console. More... | |
VR system.
deVRSystem::deVRSystem | ( | deEngine * | engine | ) |
Create vr system.
|
virtual |
Clean up vr system.
|
virtual |
Clearcross references and links that could lead to memory leaks.
Do not forget to call the super function.
Reimplemented from deBaseSystem.
|
inline |
Active module or nullptr if none is active.
|
inline |
Camera to render on head mounted display or nullptr.
|
inline |
Presenting user environment inside the rendered world is enabled.
Has no effect if SupportsPassthrough() returns false.
|
inline |
VR queue.
|
inline |
|
inline |
Transparency of user environment presented inside the rendered world.
Has no effect if SupportsPassthrough() returns false. A value of 0 hides the environment. A value of 1 shows the environment. Values in between blend over.
|
virtual |
Carry out here actions right after the system started up.
Reimplemented from deBaseSystem.
|
virtual |
Carry out here actions right before the system shuts down.
Reimplemented from deBaseSystem.
void deVRSystem::ProcessEvents | ( | ) |
Add events to the VR System event queue.
This function is called before any other frame related tasks are carried out. Record changes in devices states have to be recored into a game event reported as engine input events You are expected to check message and event queues to deliver system notification (like quitting the game) to the game engine.
void deVRSystem::RequestFeatureEyeGazeTracking | ( | deBaseVRModule::eFeatureSupportLevel | level | ) |
Set feature request level for eye gaze tracking.
Tracking eye gaze features is consider a high privacy operation by most VR environments. Enabling this feature usually requires the user to explicitely agree. Furthermore eye gaze tracking is not required for the majority of games and applications. For these reasons eye gaze tracking is disabled by default. To enable set the feature request level to optional or required.
The set feature request level takes effect only the next time StartRuntime() is called. It has no effect while the VR runtime is running.
If the VR module does not support eye gaze tracking and sFeatureSupport::efslRequired is specified an exception is thrown.
void deVRSystem::RequestFeatureFacialTracking | ( | deBaseVRModule::eFeatureSupportLevel | level | ) |
Set feature request level for facial tracking.
Facial tracking includes eye tracking and mouth tracking. Tracking facial features is consider a high privacy operation by most VR environments. Enabling this feature usually requires the user to explicitely agree. Furthermore facial tracking typically is an expensive operation and can degrade performance. Last but not least facial tracking is not required for the majority of games and applications. For this reason facial tracking is disabled by default. To enable set the feature request level to optional or required.
The set feature request level takes effect only the next time StartRuntime() is called. It has no effect while the VR runtime is running.
If the VR module does not support facial tracking and sFeatureSupport::efslRequired is specified an exception is thrown.
bool deVRSystem::RuntimeUsable | ( | ) |
VR Runtime is usable.
Returns true if a call to StartRuntime() is likely to succeed or not.
|
virtual |
Set active loadable module.
Do not forget to call the super function.
Reimplemented from deBaseSystem.
void deVRSystem::SetCamera | ( | deCamera * | camera | ) |
Set camera to render on head mounted display.
If set to nullptr fades back to safe scene as defined by VR Runtime.
void deVRSystem::SetEnablePassthrough | ( | bool | enable | ) |
Enable presenting user environment inside the rendered world.
Has no effect if SupportsPassthrough() returns false.
void deVRSystem::SetPassthroughTransparency | ( | float | transparency | ) |
Set transparency of user environment presented inside the rendered world.
Has no effect if SupportsPassthrough() returns false. A value of 0 hides the environment. A value of 1 shows the environment. Values in between blend over.
void deVRSystem::StartRuntime | ( | ) |
Start VR.
VR systems typically are required to be activated before they can be used. Starting VR connects the engine to the VR system present on the host system and activates VR support on various modules. VR mode can be started and stopped at any time.
void deVRSystem::StopRuntime | ( | ) |
Stop VR.
VR systems typically are required to be activated before they can be used. Starting VR connects the engine to the VR system present on the host system and activates VR support on various modules. VR mode can be started and stopped at any time.
bool deVRSystem::SupportsPassthrough | ( | ) |
VR Runtime supports presenting user environment inside the rendered world.