Blender  V3.3
Public Types | List of all members
GHOST_XrSession Class Reference

#include <GHOST_XrSession.h>

Public Types

enum  LifeExpectancy { SESSION_KEEP_ALIVE , SESSION_DESTROY }
 

Public Member Functions

State Queries
bool isRunning () const
 
Actions
bool createActionSet (const GHOST_XrActionSetInfo &info)
 
void destroyActionSet (const char *action_set_name)
 
bool createActions (const char *action_set_name, uint32_t count, const GHOST_XrActionInfo *infos)
 
void destroyActions (const char *action_set_name, uint32_t count, const char *const *action_names)
 
bool createActionBindings (const char *action_set_name, uint32_t count, const GHOST_XrActionProfileInfo *infos)
 
void destroyActionBindings (const char *action_set_name, uint32_t count, const char *const *action_names, const char *const *profile_paths)
 
bool attachActionSets ()
 
bool syncActions (const char *action_set_name=nullptr)
 
bool applyHapticAction (const char *action_set_name, const char *action_name, const char *subaction_path, const int64_t &duration, const float &frequency, const float &amplitude)
 
void stopHapticAction (const char *action_set_name, const char *action_name, const char *subaction_path)
 
voidgetActionSetCustomdata (const char *action_set_name)
 
voidgetActionCustomdata (const char *action_set_name, const char *action_name)
 
uint32_t getActionCount (const char *action_set_name)
 
void getActionCustomdataArray (const char *action_set_name, void **r_customdata_array)
 
Controller Model
bool loadControllerModel (const char *subaction_path)
 
void unloadControllerModel (const char *subaction_path)
 
bool updateControllerModelComponents (const char *subaction_path)
 
bool getControllerModelData (const char *subaction_path, GHOST_XrControllerModelData &r_data)
 

Create, Initialize and Destruct

 GHOST_XrSession (GHOST_XrContext &xr_context)
 
 ~GHOST_XrSession ()
 

State Management

void start (const GHOST_XrSessionBeginInfo *begin_info)
 
void requestEnd ()
 
LifeExpectancy handleStateChangeEvent (const XrEventDataSessionStateChanged &lifecycle)
 

Drawing

bool needsUpsideDownDrawing () const
 
void draw (void *draw_customdata)
 

Graphics Context Injection

Sessions need access to Ghost graphics context information. Additionally, this API allows creating contexts on the fly (created on start, destructed on end). For this, callbacks to bind (potentially create) and unbind (potentially destruct) a Ghost graphics context have to be set, which will be called on session start and end respectively.

void unbindGraphicsContext ()
 

Detailed Description

Definition at line 19 of file GHOST_XrSession.h.

Member Enumeration Documentation

◆ LifeExpectancy

Enumerator
SESSION_KEEP_ALIVE 
SESSION_DESTROY 

Definition at line 21 of file GHOST_XrSession.h.

Constructor & Destructor Documentation

◆ GHOST_XrSession()

GHOST_XrSession::GHOST_XrSession ( GHOST_XrContext xr_context)

Definition at line 62 of file GHOST_XrSession.cpp.

◆ ~GHOST_XrSession()

GHOST_XrSession::~GHOST_XrSession ( )

Member Function Documentation

◆ applyHapticAction()

bool GHOST_XrSession::applyHapticAction ( const char *  action_set_name,
const char *  action_name,
const char *  subaction_path,
const int64_t duration,
const float frequency,
const float amplitude 
)

◆ attachActionSets()

bool GHOST_XrSession::attachActionSets ( )

Definition at line 730 of file GHOST_XrSession.cpp.

References CHECK_XR, GHOST_XrContext::getInstance(), and instance.

◆ createActionBindings()

bool GHOST_XrSession::createActionBindings ( const char *  action_set_name,
uint32_t  count,
const GHOST_XrActionProfileInfo *  infos 
)

◆ createActions()

bool GHOST_XrSession::createActions ( const char *  action_set_name,
uint32_t  count,
const GHOST_XrActionInfo *  infos 
)

◆ createActionSet()

bool GHOST_XrSession::createActionSet ( const GHOST_XrActionSetInfo &  info)

Action functions to be called pre-session start. NOTE: The "destroy" functions can also be called post-session start.

Definition at line 627 of file GHOST_XrSession.cpp.

References GHOST_XrContext::getInstance(), and instance.

◆ destroyActionBindings()

void GHOST_XrSession::destroyActionBindings ( const char *  action_set_name,
uint32_t  count,
const char *const *  action_names,
const char *const *  profile_paths 
)

◆ destroyActions()

void GHOST_XrSession::destroyActions ( const char *  action_set_name,
uint32_t  count,
const char *const *  action_names 
)

Definition at line 670 of file GHOST_XrSession.cpp.

References count, GHOST_XrActionSet::destroyAction(), and find_action_set().

◆ destroyActionSet()

void GHOST_XrSession::destroyActionSet ( const char *  action_set_name)

Definition at line 642 of file GHOST_XrSession.cpp.

◆ draw()

void GHOST_XrSession::draw ( void draw_customdata)

Definition at line 443 of file GHOST_XrSession.cpp.

◆ getActionCount()

uint32_t GHOST_XrSession::getActionCount ( const char *  action_set_name)

Definition at line 891 of file GHOST_XrSession.cpp.

References find_action_set(), and GHOST_XrActionSet::getActionCount().

◆ getActionCustomdata()

void * GHOST_XrSession::getActionCustomdata ( const char *  action_set_name,
const char *  action_name 
)

◆ getActionCustomdataArray()

void GHOST_XrSession::getActionCustomdataArray ( const char *  action_set_name,
void **  r_customdata_array 
)

◆ getActionSetCustomdata()

void * GHOST_XrSession::getActionSetCustomdata ( const char *  action_set_name)

Definition at line 866 of file GHOST_XrSession.cpp.

References find_action_set(), and GHOST_XrActionSet::getCustomdata().

◆ getControllerModelData()

bool GHOST_XrSession::getControllerModelData ( const char *  subaction_path,
GHOST_XrControllerModelData &  r_data 
)

Definition at line 966 of file GHOST_XrSession.cpp.

◆ handleStateChangeEvent()

GHOST_XrSession::LifeExpectancy GHOST_XrSession::handleStateChangeEvent ( const XrEventDataSessionStateChanged &  lifecycle)

Definition at line 272 of file GHOST_XrSession.cpp.

References SESSION_DESTROY, and SESSION_KEEP_ALIVE.

◆ isRunning()

bool GHOST_XrSession::isRunning ( ) const

Definition at line 567 of file GHOST_XrSession.cpp.

◆ loadControllerModel()

bool GHOST_XrSession::loadControllerModel ( const char *  subaction_path)

Controller model functions.

Definition at line 919 of file GHOST_XrSession.cpp.

References GHOST_XrContext::getInstance(), instance, and GHOST_XrContext::isExtensionEnabled().

◆ needsUpsideDownDrawing()

bool GHOST_XrSession::needsUpsideDownDrawing ( ) const

Definition at line 556 of file GHOST_XrSession.cpp.

◆ requestEnd()

void GHOST_XrSession::requestEnd ( )

Definition at line 254 of file GHOST_XrSession.cpp.

◆ start()

void GHOST_XrSession::start ( const GHOST_XrSessionBeginInfo *  begin_info)

◆ stopHapticAction()

void GHOST_XrSession::stopHapticAction ( const char *  action_set_name,
const char *  action_name,
const char *  subaction_path 
)

◆ syncActions()

bool GHOST_XrSession::syncActions ( const char *  action_set_name = nullptr)

Action functions to be called post-session start.

Parameters
action_set_nameWhen nullptr, all attached action sets will be synced.

Definition at line 773 of file GHOST_XrSession.cpp.

References CHECK_XR, find_action_set(), GHOST_XrActionSet::getActionSet(), and GHOST_XrActionSet::updateStates().

◆ unbindGraphicsContext()

void GHOST_XrSession::unbindGraphicsContext ( )

◆ unloadControllerModel()

void GHOST_XrSession::unloadControllerModel ( const char *  subaction_path)

Definition at line 944 of file GHOST_XrSession.cpp.

◆ updateControllerModelComponents()

bool GHOST_XrSession::updateControllerModelComponents ( const char *  subaction_path)

Definition at line 952 of file GHOST_XrSession.cpp.


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