summaryrefslogtreecommitdiff
path: root/servers/xr/xr_pose.h
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2022-01-19 19:21:06 +1100
committerBastiaan Olij <mux213@gmail.com>2022-01-20 10:35:50 +1100
commit173105596e428cd4cd043a158c10b71f612f9783 (patch)
tree56df36e6d05847ec4610e075e3e5bc8439987209 /servers/xr/xr_pose.h
parentf8b8d0d4b82a5eb6ea3829398fd5076f1c49c148 (diff)
Adding a tracking confidence state to XRPose
Diffstat (limited to 'servers/xr/xr_pose.h')
-rw-r--r--servers/xr/xr_pose.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/servers/xr/xr_pose.h b/servers/xr/xr_pose.h
index 8c1fc63360..f306c22390 100644
--- a/servers/xr/xr_pose.h
+++ b/servers/xr/xr_pose.h
@@ -37,12 +37,20 @@ class XRPose : public RefCounted {
GDCLASS(XRPose, RefCounted);
public:
+ // TrackingConfidence gives an indication of how reliable our transform data is.
+ enum TrackingConfidence {
+ XR_TRACKING_CONFIDENCE_NONE, // No tracking information is available for this pose.
+ XR_TRACKING_CONFIDENCE_LOW, // Tracking information may be inaccurate or estimated.
+ XR_TRACKING_CONFIDENCE_HIGH // Tracking information is deemed accurate and up to date.
+ };
+
private:
bool has_tracking_data = false;
StringName name;
Transform3D transform;
Vector3 linear_velocity;
Vector3 angular_velocity;
+ TrackingConfidence tracking_confidence = XR_TRACKING_CONFIDENCE_NONE;
protected:
static void _bind_methods();
@@ -63,6 +71,11 @@ public:
void set_angular_velocity(const Vector3 p_velocity);
Vector3 get_angular_velocity() const;
+
+ void set_tracking_confidence(const TrackingConfidence p_tracking_confidence);
+ TrackingConfidence get_tracking_confidence() const;
};
+VARIANT_ENUM_CAST(XRPose::TrackingConfidence);
+
#endif