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.
The function counts world objects which have at least one of the component types specified by typeMask. If the caller specifies zero as typeMask, then the function returns all objects. See varjo_WorldComponentTypeMask for the list of component types.
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.
Use varjo_WorldGetObjectCount with the same typeMask before calling this function to get the number of objects which will be returned by this function.
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. See varjo_WorldFlags for supported values for worldFlags.
session | Varjo session the world should be initialized for. |
worldFlags | Configuration 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. See varjo_WorldObjectMarkerFlags.
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.
varjo_WorldSync must be called to get up to date information about tracked objects from the API. The state of the information about tracked objects only changes when varjo_WorldSync is called. The information about tracked objects does not changed between two consecutive calls to varjo_WorldSync. Typically an application using this API calls varjo_WorldSync once per frame.
world | World to sync. |