Go to the source code of this file.
Functions | |
struct varjo_World * | varjo_WorldInit (struct varjo_Session *session, varjo_WorldFlags worldFlags) |
Initialize a world. More... | |
void | varjo_WorldDestroy (struct varjo_World *world) |
Destroy a varjo_World instance. More... | |
void | varjo_WorldSync (struct varjo_World *world) |
Sync all objects tracked in the world. More... | |
int64_t | varjo_WorldGetObjectCount (struct varjo_World *world, varjo_WorldComponentTypeMask typeMask) |
Get the number of objects in the world. More... | |
int64_t | varjo_WorldGetObjects (struct varjo_World *world, struct varjo_WorldObject *objects, int64_t maxObjectCount, varjo_WorldComponentTypeMask typeMask) |
Get a list of objects in the world. More... | |
varjo_Bool | varjo_WorldGetPoseComponent (struct varjo_World *world, varjo_WorldObjectId id, struct varjo_WorldPoseComponent *component, varjo_Nanoseconds displayTime) |
Get a pose component. More... | |
varjo_Bool | varjo_WorldGetObjectMarkerComponent (struct varjo_World *world, varjo_WorldObjectId id, struct varjo_WorldObjectMarkerComponent *component) |
Get a object marker component. More... | |
void | varjo_WorldSetObjectMarkerTimeouts (struct varjo_World *world, varjo_WorldMarkerId *ids, int64_t idCount, varjo_Nanoseconds duration) |
Sets a desired lifetime duration for specified markers. More... | |
void | varjo_WorldSetObjectMarkerFlags (struct varjo_World *world, varjo_WorldMarkerId *ids, int64_t idCount, varjo_WorldObjectMarkerFlags flags) |
Sets flags for specifed markers. More... | |
void varjo_WorldDestroy | ( | struct varjo_World * | world | ) |
Destroy a varjo_World instance.
world | Varjo world instance to destroy. |
int64_t varjo_WorldGetObjectCount | ( | struct varjo_World * | world, |
varjo_WorldComponentTypeMask | typeMask | ||
) |
Get the number of objects in the world.
world | World to get the objects from. |
typeMask | Mask of the desired object types. Zero if you want all of them. |
varjo_Bool varjo_WorldGetObjectMarkerComponent | ( | struct varjo_World * | world, |
varjo_WorldObjectId | id, | ||
struct varjo_WorldObjectMarkerComponent * | component | ||
) |
Get a object marker component.
varjo_WorldObject::typeMask should be checked before trying to get components.
world | World to get the component from. |
id | Id of the object. |
component | Pointer to the component to fill. |
int64_t varjo_WorldGetObjects | ( | struct varjo_World * | world, |
struct varjo_WorldObject * | objects, | ||
int64_t | maxObjectCount, | ||
varjo_WorldComponentTypeMask | typeMask | ||
) |
Get a list of objects in the world.
world | World to get the objects from. |
objects | Output pointer for the objects. |
maxObjectCount | Maximum object count. |
typeMask | Mask of the desired object types. Zero if you want all of them. |
varjo_Bool varjo_WorldGetPoseComponent | ( | struct varjo_World * | world, |
varjo_WorldObjectId | id, | ||
struct varjo_WorldPoseComponent * | component, | ||
varjo_Nanoseconds | displayTime | ||
) |
Get a pose component.
varjo_WorldObject::typeMask should be checked before trying to get components. Pose is extrapolated for the given timestamp.
The extrapolated pose may not match the real pose if the tracking system gets better data during the extrapolated time frame.
The timestamp can be in the past to a certain degree, there is a small history kept each time varjo_WorldSync is called.
Use varjo_FrameGetDisplayTime to get the time the frame is going to be displayed. This is going to give the best results in most cases.
world | World to get the component from. |
id | Id of the object. |
component | Pointer to the component to fill. |
displayTime | Absolute timestamp the tracking data is needed for. |
struct varjo_World* varjo_WorldInit | ( | struct varjo_Session * | session, |
varjo_WorldFlags | worldFlags | ||
) |
Initialize a world.
One varjo_Session can have multiple worlds. Each world has it own set of objects and they can overlap if the worlds have the same flags. The same physical object can be represented by a different id in a different varjo_World.
session | Varjo session the world should be initialized for. |
worldFlags | Flags for the world initialization. |
void varjo_WorldSetObjectMarkerFlags | ( | struct varjo_World * | world, |
varjo_WorldMarkerId * | ids, | ||
int64_t | idCount, | ||
varjo_WorldObjectMarkerFlags | flags | ||
) |
Sets flags for specifed markers.
Replaces all flags set previously for the specified markers.
world | Varjo world handle. |
ids | Ids of the markers to set the flags for. |
idCount | Number of ids to set. |
flags | Marker flags to set. |
void varjo_WorldSetObjectMarkerTimeouts | ( | struct varjo_World * | world, |
varjo_WorldMarkerId * | ids, | ||
int64_t | idCount, | ||
varjo_Nanoseconds | duration | ||
) |
Sets a desired lifetime duration for specified markers.
Markers that have not been tracked for a period of time exceeding duration
will not be returned by varjo_WorldGetObjects.
Once a marker is expired, the world object id associated with it will not be reused.
world | Varjo world handle. |
ids | Ids of the markers to use the specified timeout. |
idCount | Number of ids to set. |
duration | A time in nanoseconds for which the system will keep marker information for markers that are not currently visible. |
void varjo_WorldSync | ( | struct varjo_World * | world | ) |
Sync all objects tracked in the world.
Gets the latest tracking pose for all objects in the world. varjo_WorldGetObjects will return the latest state for each component type after this call.
Call this function every time you want to get the latest tracking data from Varjo backend.
world | World to sync. |