summaryrefslogtreecommitdiffstats
path: root/servers/xr/xr_body_tracker.cpp
diff options
context:
space:
mode:
authorMalcolm Nixon <Malcolm.nixon@gmail.com>2024-04-13 17:26:46 -0400
committerMalcolm Nixon <Malcolm.nixon@gmail.com>2024-04-18 20:04:01 -0400
commit823ae7b3fa25832d1cd9d7613c650bfc712d1f49 (patch)
tree36a0c75dd36faf7c15cf81a78267f71c62b3009e /servers/xr/xr_body_tracker.cpp
parent3b1806182a3564736ad64793b203c2c13c251f56 (diff)
downloadredot-engine-823ae7b3fa25832d1cd9d7613c650bfc712d1f49.tar.gz
Rework XR Trackers to have a common ancestor. Allow creation of XRNode3D to drive node positions and visibility.
Diffstat (limited to 'servers/xr/xr_body_tracker.cpp')
-rw-r--r--servers/xr/xr_body_tracker.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/servers/xr/xr_body_tracker.cpp b/servers/xr/xr_body_tracker.cpp
index cd58c14348..9c82b80911 100644
--- a/servers/xr/xr_body_tracker.cpp
+++ b/servers/xr/xr_body_tracker.cpp
@@ -134,6 +134,14 @@ void XRBodyTracker::_bind_methods() {
BIND_BITFIELD_FLAG(JOINT_FLAG_POSITION_TRACKED);
}
+void XRBodyTracker::set_tracker_type(XRServer::TrackerType p_type) {
+ ERR_FAIL_COND_MSG(p_type != XRServer::TRACKER_BODY, "XRBodyTracker must be of type TRACKER_BODY.");
+}
+
+void XRBodyTracker::set_tracker_hand(const XRPositionalTracker::TrackerHand p_hand) {
+ ERR_FAIL_COND_MSG(p_hand != XRPositionalTracker::TRACKER_HAND_UNKNOWN, "XRBodyTracker cannot specify hand.");
+}
+
void XRBodyTracker::set_has_tracking_data(bool p_has_tracking_data) {
has_tracking_data = p_has_tracking_data;
}
@@ -169,3 +177,7 @@ Transform3D XRBodyTracker::get_joint_transform(Joint p_joint) const {
ERR_FAIL_INDEX_V(p_joint, JOINT_MAX, Transform3D());
return joint_transforms[p_joint];
}
+
+XRBodyTracker::XRBodyTracker() {
+ type = XRServer::TRACKER_BODY;
+}