diff options
author | Malcolm Nixon <Malcolm.nixon@gmail.com> | 2024-04-13 17:26:46 -0400 |
---|---|---|
committer | Malcolm Nixon <Malcolm.nixon@gmail.com> | 2024-04-18 20:04:01 -0400 |
commit | 823ae7b3fa25832d1cd9d7613c650bfc712d1f49 (patch) | |
tree | 36a0c75dd36faf7c15cf81a78267f71c62b3009e /servers/xr/xr_face_tracker.cpp | |
parent | 3b1806182a3564736ad64793b203c2c13c251f56 (diff) | |
download | redot-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_face_tracker.cpp')
-rw-r--r-- | servers/xr/xr_face_tracker.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/servers/xr/xr_face_tracker.cpp b/servers/xr/xr_face_tracker.cpp index a38ccfd527..7015cd0805 100644 --- a/servers/xr/xr_face_tracker.cpp +++ b/servers/xr/xr_face_tracker.cpp @@ -187,6 +187,10 @@ void XRFaceTracker::_bind_methods() { ADD_PROPERTY_DEFAULT("blend_shapes", PackedFloat32Array()); // To prevent ludicrously large default values. } +void XRFaceTracker::set_tracker_type(XRServer::TrackerType p_type) { + ERR_FAIL_COND_MSG(p_type != XRServer::TRACKER_FACE, "XRFaceTracker must be of type TRACKER_FACE."); +} + float XRFaceTracker::get_blend_shape(BlendShapeEntry p_blend_shape) const { // Fail if the blend shape index is out of range. ERR_FAIL_INDEX_V(p_blend_shape, FT_MAX, 0.0f); @@ -220,3 +224,7 @@ void XRFaceTracker::set_blend_shapes(const PackedFloat32Array &p_blend_shapes) { // Copy the blend shape values into the blend shape array. memcpy(blend_shape_values, p_blend_shapes.ptr(), sizeof(blend_shape_values)); } + +XRFaceTracker::XRFaceTracker() { + type = XRServer::TRACKER_FACE; +} |