VR-Engage  2.3
Loading...
Searching...
No Matches
glsUtil Library API Changes

This page covers control-message helpers in glsUtil/glsVreMessageUtil.h. Review these calls if your application acquires joystick function groups or VR-Engage roles.

Breaking changes

Role control now uses a separate message

The three-argument makVre::takeControlOf() overload still compiles, but its message behavior changed. Previously it put both function groups and roles into one VrfTakeControlOfMessage. It now queues a VrfTakeControlOfMessage for function groups and a separate VrfSetVreControlledMessage to add roles. The role-control message uses an empty station ID. Do not assume the old call queues only one message.

// 2.2: one message carried both function groups and roles.
makVre::takeControlOf(entity, functionGroups, roles);
// 2.3: control the function groups and roles independently.
makVre::takeControlOf(entity, functionGroups);
makVre::setVreControlled(entity, stationId, roles, true);
static void setVreControlled(const DtEntityIdentifier &entity, const std::string &stationId, const std::vector< std::string > &roles, bool controlled, bool ignoreErrors=false)
Sets VR-Engage role control for an entity.
Definition glsVreMessageUtil.h:228
static void takeControlOf(const DtEntityIdentifier &entity, const std::vector< std::string > &functionGroups)
Takes joystick control of an entity for specific function groups.
Definition glsVreMessageUtil.h:200

The old three-argument call remains available if an empty station ID is appropriate. Update custom handlers that interpret role acquisition from VrfTakeControlOfMessage. Handle VrfSetVreControlledMessage for role changes instead. If role control needs a specific station ID, use setVreControlled() explicitly rather than relying on the three-argument overload.

Additions

The makVre namespace adds two independently callable helpers in glsUtil/glsVreMessageUtil.h:

static inline void takeControlOf(
const DtEntityIdentifier& entity,
const std::vector<std::string>& functionGroups);
static inline void setVreControlled(
const DtEntityIdentifier& entity,
const std::string& stationId,
const std::vector<std::string>& roles,
bool controlled,
bool ignoreErrors = false);

Call the two-argument takeControlOf() for joystick control without changing roles. Call setVreControlled() with controlled = true to add roles or false to remove them. Set ignoreErrors when releasing roles that might not currently be tracked.