Skip to main content

SteamVRPose

A class in Root.Township, the global namespace.

Tracks the pose of one SteamVR tracked device index. SteamVRDeviceLifecycle keeps a list of these and feeds them new poses each frame. Client only.

Constructors​

MemberWhat it is
SteamVRPose(SteamVR_TrackedObject.EIndex index)Creates a SteamVRPose from index.

Fields​

1 private and internal field
MemberWhat it is
private int indexIndex as an int, used to read this device from the SteamVR pose array.

Properties​

MemberWhat it is
SteamVR_TrackedObject.EIndex Index { get; private set; }The SteamVR tracked device index this pose follows.
bool IsConnected { get; private set; }Whether the device counts as connected. Nothing in this class ever sets it to true.
bool IsEnabled { get; set; }When false, SteamVRDeviceLifecycle skips this pose in its pose update.
bool IsReserved { get; set; }Flag the device lifecycle uses to mark a pose as taken.
Vector3 Position { get; private set; }Last tracked position, in tracking space.
Quaternion Rotation { get; private set; }Last tracked rotation, in tracking space.

Events​

MemberWhat it is
event PoseChangedHandler ChangedRaised every time the pose is updated.
event Action ConnectedRaised when the device connects. The method that raises it is private and nothing calls it, so probably never fires.
event Action DisconnectedRaised by OnDisconnected when a connected device goes away.

Methods​

MemberWhat it is
void HandleUpdate(Vector3 localPosition, Quaternion localRotation)Sets the position and rotation, either directly or from the SteamVR pose array (skipped when that device's pose is invalid or disconnected).
void HandleUpdate(TrackedDevicePose_t[] poses)Sets the position and rotation, either directly or from the SteamVR pose array (skipped when that device's pose is invalid or disconnected).
void OnDisconnected()Marks the device disconnected and raises Disconnected if it was connected.
1 private and internal method
MemberWhat it is
private void OnConnected()Marks the device connected and raises Connected the first time. Private and not called anywhere in the server build.

Used in​

Members of other types that take, return or hold a SteamVRPose: