diff options
author | Malcolm Nixon <Malcolm.nixon@gmail.com> | 2024-02-24 19:20:11 -0500 |
---|---|---|
committer | Malcolm Nixon <Malcolm.nixon@gmail.com> | 2024-02-27 19:51:59 -0500 |
commit | 57aa7345627075fa4cf3f1de33bcddf67baafe80 (patch) | |
tree | 65197395e798f2db30789ae4f0e65c0cf6e2b8f1 /doc/classes | |
parent | bb6b06c81343073f10cbbd2af515cf0dac1e6549 (diff) | |
download | redot-engine-57aa7345627075fa4cf3f1de33bcddf67baafe80.tar.gz |
Add body tracking support.
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/XRBodyModifier3D.xml | 49 | ||||
-rw-r--r-- | doc/classes/XRBodyTracker.xml | 307 | ||||
-rw-r--r-- | doc/classes/XRServer.xml | 48 |
3 files changed, 404 insertions, 0 deletions
diff --git a/doc/classes/XRBodyModifier3D.xml b/doc/classes/XRBodyModifier3D.xml new file mode 100644 index 0000000000..4227bc57df --- /dev/null +++ b/doc/classes/XRBodyModifier3D.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="XRBodyModifier3D" inherits="Node3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + A node for driving body meshes from [XRBodyTracker] data. + </brief_description> + <description> + This node uses body tracking data from a [XRBodyTracker] to animate the skeleton of a body mesh. + </description> + <tutorials> + <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> + </tutorials> + <members> + <member name="body_tracker" type="StringName" setter="set_body_tracker" getter="get_body_tracker" default="&"/user/body""> + The name of the [XRBodyTracker] registered with [XRServer] to obtain the body tracking data from. + </member> + <member name="body_update" type="int" setter="set_body_update" getter="get_body_update" enum="XRBodyModifier3D.BodyUpdate" is_bitfield="true" default="7"> + Specifies the body parts to update. + </member> + <member name="bone_update" type="int" setter="set_bone_update" getter="get_bone_update" enum="XRBodyModifier3D.BoneUpdate" default="0"> + Specifies the type of updates to perform on the bones. + </member> + <member name="show_when_tracked" type="bool" setter="set_show_when_tracked" getter="get_show_when_tracked" default="true"> + If true then the nodes visibility is determined by whether tracking data is available. + </member> + <member name="target" type="NodePath" setter="set_target" getter="get_target" default="NodePath("")"> + A [NodePath] to a [Skeleton3D] to animate. + </member> + </members> + <constants> + <constant name="BODY_UPDATE_UPPER_BODY" value="1" enum="BodyUpdate" is_bitfield="true"> + The skeleton's upper body joints are updated. + </constant> + <constant name="BODY_UPDATE_LOWER_BODY" value="2" enum="BodyUpdate" is_bitfield="true"> + The skeleton's lower body joints are updated. + </constant> + <constant name="BODY_UPDATE_HANDS" value="4" enum="BodyUpdate" is_bitfield="true"> + The skeleton's hand joints are updated. + </constant> + <constant name="BONE_UPDATE_FULL" value="0" enum="BoneUpdate"> + The skeleton's bones are fully updated (both position and rotation) to match the tracked bones. + </constant> + <constant name="BONE_UPDATE_ROTATION_ONLY" value="1" enum="BoneUpdate"> + The skeleton's bones are only rotated to align with the tracked bones, preserving bone length. + </constant> + <constant name="BONE_UPDATE_MAX" value="2" enum="BoneUpdate"> + Represents the size of the [enum BoneUpdate] enum. + </constant> + </constants> +</class> diff --git a/doc/classes/XRBodyTracker.xml b/doc/classes/XRBodyTracker.xml new file mode 100644 index 0000000000..5d45ad11bd --- /dev/null +++ b/doc/classes/XRBodyTracker.xml @@ -0,0 +1,307 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="XRBodyTracker" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + A tracked body in XR. + </brief_description> + <description> + A body tracking system will create an instance of this object and add it to the [XRServer]. This tracking system will then obtain skeleton data, convert it to the Godot Humanoid skeleton and store this data on the [XRBodyTracker] object. + Use [XRBodyModifier3D] to animate a body mesh using body tracking data. + </description> + <tutorials> + <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> + </tutorials> + <methods> + <method name="get_joint_flags" qualifiers="const"> + <return type="int" enum="XRBodyTracker.JointFlags" is_bitfield="true" /> + <param index="0" name="joint" type="int" enum="XRBodyTracker.Joint" /> + <description> + Returns flags about the validity of the tracking data for the given body joint (see [enum XRBodyTracker.JointFlags]). + </description> + </method> + <method name="get_joint_transform" qualifiers="const"> + <return type="Transform3D" /> + <param index="0" name="joint" type="int" enum="XRBodyTracker.Joint" /> + <description> + Returns the transform for the given body joint. + </description> + </method> + <method name="set_joint_flags"> + <return type="void" /> + <param index="0" name="joint" type="int" enum="XRBodyTracker.Joint" /> + <param index="1" name="flags" type="int" enum="XRBodyTracker.JointFlags" is_bitfield="true" /> + <description> + Sets flags about the validity of the tracking data for the given body joint. + </description> + </method> + <method name="set_joint_transform"> + <return type="void" /> + <param index="0" name="joint" type="int" enum="XRBodyTracker.Joint" /> + <param index="1" name="transform" type="Transform3D" /> + <description> + Sets the transform for the given body joint. + </description> + </method> + </methods> + <members> + <member name="body_flags" type="int" setter="set_body_flags" getter="get_body_flags" enum="XRBodyTracker.BodyFlags" is_bitfield="true" default="0"> + The type of body tracking data captured. + </member> + <member name="has_tracking_data" type="bool" setter="set_has_tracking_data" getter="get_has_tracking_data" default="false"> + If [code]true[/code], the body tracking data is valid. + </member> + </members> + <constants> + <constant name="BODY_FLAG_UPPER_BODY_SUPPORTED" value="1" enum="BodyFlags" is_bitfield="true"> + Upper body tracking supported. + </constant> + <constant name="BODY_FLAG_LOWER_BODY_SUPPORTED" value="2" enum="BodyFlags" is_bitfield="true"> + Lower body tracking supported. + </constant> + <constant name="BODY_FLAG_HANDS_SUPPORTED" value="4" enum="BodyFlags" is_bitfield="true"> + Hand tracking supported. + </constant> + <constant name="JOINT_ROOT" value="0" enum="Joint"> + Root joint. + </constant> + <constant name="JOINT_HIPS" value="1" enum="Joint"> + Hips joint. + </constant> + <constant name="JOINT_SPINE" value="2" enum="Joint"> + Spine joint. + </constant> + <constant name="JOINT_CHEST" value="3" enum="Joint"> + Chest joint. + </constant> + <constant name="JOINT_UPPER_CHEST" value="4" enum="Joint"> + Upper chest joint. + </constant> + <constant name="JOINT_NECK" value="5" enum="Joint"> + Neck joint. + </constant> + <constant name="JOINT_HEAD" value="6" enum="Joint"> + Head joint. + </constant> + <constant name="JOINT_HEAD_TIP" value="7" enum="Joint"> + Head tip joint. + </constant> + <constant name="JOINT_LEFT_SHOULDER" value="8" enum="Joint"> + Left shoulder joint. + </constant> + <constant name="JOINT_LEFT_UPPER_ARM" value="9" enum="Joint"> + Left upper arm joint. + </constant> + <constant name="JOINT_LEFT_LOWER_ARM" value="10" enum="Joint"> + Left lower arm joint. + </constant> + <constant name="JOINT_RIGHT_SHOULDER" value="11" enum="Joint"> + Right shoulder joint. + </constant> + <constant name="JOINT_RIGHT_UPPER_ARM" value="12" enum="Joint"> + Right upper arm joint. + </constant> + <constant name="JOINT_RIGHT_LOWER_ARM" value="13" enum="Joint"> + Right lower arm joint. + </constant> + <constant name="JOINT_LEFT_UPPER_LEG" value="14" enum="Joint"> + Left upper leg joint. + </constant> + <constant name="JOINT_LEFT_LOWER_LEG" value="15" enum="Joint"> + Left lower leg joint. + </constant> + <constant name="JOINT_LEFT_FOOT" value="16" enum="Joint"> + Left foot joint. + </constant> + <constant name="JOINT_LEFT_TOES" value="17" enum="Joint"> + Left toes joint. + </constant> + <constant name="JOINT_RIGHT_UPPER_LEG" value="18" enum="Joint"> + Right upper leg joint. + </constant> + <constant name="JOINT_RIGHT_LOWER_LEG" value="19" enum="Joint"> + Right lower leg joint. + </constant> + <constant name="JOINT_RIGHT_FOOT" value="20" enum="Joint"> + Right foot joint. + </constant> + <constant name="JOINT_RIGHT_TOES" value="21" enum="Joint"> + Right toes joint. + </constant> + <constant name="JOINT_LEFT_HAND" value="22" enum="Joint"> + Left hand joint. + </constant> + <constant name="JOINT_LEFT_PALM" value="23" enum="Joint"> + Left palm joint. + </constant> + <constant name="JOINT_LEFT_WRIST" value="24" enum="Joint"> + Left wrist joint. + </constant> + <constant name="JOINT_LEFT_THUMB_METACARPAL" value="25" enum="Joint"> + Left thumb metacarpal joint. + </constant> + <constant name="JOINT_LEFT_THUMB_PHALANX_PROXIMAL" value="26" enum="Joint"> + Left thumb phalanx proximal joint. + </constant> + <constant name="JOINT_LEFT_THUMB_PHALANX_DISTAL" value="27" enum="Joint"> + Left thumb phalanx distal joint. + </constant> + <constant name="JOINT_LEFT_THUMB_TIP" value="28" enum="Joint"> + Left thumb tip joint. + </constant> + <constant name="JOINT_LEFT_INDEX_FINGER_METACARPAL" value="29" enum="Joint"> + Left index finger metacarpal joint. + </constant> + <constant name="JOINT_LEFT_INDEX_FINGER_PHALANX_PROXIMAL" value="30" enum="Joint"> + Left index finger phalanx proximal joint. + </constant> + <constant name="JOINT_LEFT_INDEX_FINGER_PHALANX_INTERMEDIATE" value="31" enum="Joint"> + Left index finger phalanx intermediate joint. + </constant> + <constant name="JOINT_LEFT_INDEX_FINGER_PHALANX_DISTAL" value="32" enum="Joint"> + Left index finger phalanx distal joint. + </constant> + <constant name="JOINT_LEFT_INDEX_FINGER_TIP" value="33" enum="Joint"> + Left index finger tip joint. + </constant> + <constant name="JOINT_LEFT_MIDDLE_FINGER_METACARPAL" value="34" enum="Joint"> + Left middle finger metacarpal joint. + </constant> + <constant name="JOINT_LEFT_MIDDLE_FINGER_PHALANX_PROXIMAL" value="35" enum="Joint"> + Left middle finger phalanx proximal joint. + </constant> + <constant name="JOINT_LEFT_MIDDLE_FINGER_PHALANX_INTERMEDIATE" value="36" enum="Joint"> + Left middle finger phalanx intermediate joint. + </constant> + <constant name="JOINT_LEFT_MIDDLE_FINGER_PHALANX_DISTAL" value="37" enum="Joint"> + Left middle finger phalanx distal joint. + </constant> + <constant name="JOINT_LEFT_MIDDLE_FINGER_TIP" value="38" enum="Joint"> + Left middle finger tip joint. + </constant> + <constant name="JOINT_LEFT_RING_FINGER_METACARPAL" value="39" enum="Joint"> + Left ring finger metacarpal joint. + </constant> + <constant name="JOINT_LEFT_RING_FINGER_PHALANX_PROXIMAL" value="40" enum="Joint"> + Left ring finger phalanx proximal joint. + </constant> + <constant name="JOINT_LEFT_RING_FINGER_PHALANX_INTERMEDIATE" value="41" enum="Joint"> + Left ring finger phalanx intermediate joint. + </constant> + <constant name="JOINT_LEFT_RING_FINGER_PHALANX_DISTAL" value="42" enum="Joint"> + Left ring finger phalanx distal joint. + </constant> + <constant name="JOINT_LEFT_RING_FINGER_TIP" value="43" enum="Joint"> + Left ring finger tip joint. + </constant> + <constant name="JOINT_LEFT_PINKY_FINGER_METACARPAL" value="44" enum="Joint"> + Left pinky finger metacarpal joint. + </constant> + <constant name="JOINT_LEFT_PINKY_FINGER_PHALANX_PROXIMAL" value="45" enum="Joint"> + Left pinky finger phalanx proximal joint. + </constant> + <constant name="JOINT_LEFT_PINKY_FINGER_PHALANX_INTERMEDIATE" value="46" enum="Joint"> + Left pinky finger phalanx intermediate joint. + </constant> + <constant name="JOINT_LEFT_PINKY_FINGER_PHALANX_DISTAL" value="47" enum="Joint"> + Left pinky finger phalanx distal joint. + </constant> + <constant name="JOINT_LEFT_PINKY_FINGER_TIP" value="48" enum="Joint"> + Left pinky finger tip joint. + </constant> + <constant name="JOINT_RIGHT_HAND" value="49" enum="Joint"> + Right hand joint. + </constant> + <constant name="JOINT_RIGHT_PALM" value="50" enum="Joint"> + Right palm joint. + </constant> + <constant name="JOINT_RIGHT_WRIST" value="51" enum="Joint"> + Right wrist joint. + </constant> + <constant name="JOINT_RIGHT_THUMB_METACARPAL" value="52" enum="Joint"> + Right thumb metacarpal joint. + </constant> + <constant name="JOINT_RIGHT_THUMB_PHALANX_PROXIMAL" value="53" enum="Joint"> + Right thumb phalanx proximal joint. + </constant> + <constant name="JOINT_RIGHT_THUMB_PHALANX_DISTAL" value="54" enum="Joint"> + Right thumb phalanx distal joint. + </constant> + <constant name="JOINT_RIGHT_THUMB_TIP" value="55" enum="Joint"> + Right thumb tip joint. + </constant> + <constant name="JOINT_RIGHT_INDEX_FINGER_METACARPAL" value="56" enum="Joint"> + Right index finger metacarpal joint. + </constant> + <constant name="JOINT_RIGHT_INDEX_FINGER_PHALANX_PROXIMAL" value="57" enum="Joint"> + Right index finger phalanx proximal joint. + </constant> + <constant name="JOINT_RIGHT_INDEX_FINGER_PHALANX_INTERMEDIATE" value="58" enum="Joint"> + Right index finger phalanx intermediate joint. + </constant> + <constant name="JOINT_RIGHT_INDEX_FINGER_PHALANX_DISTAL" value="59" enum="Joint"> + Right index finger phalanx distal joint. + </constant> + <constant name="JOINT_RIGHT_INDEX_FINGER_TIP" value="60" enum="Joint"> + Right index finger tip joint. + </constant> + <constant name="JOINT_RIGHT_MIDDLE_FINGER_METACARPAL" value="61" enum="Joint"> + Right middle finger metacarpal joint. + </constant> + <constant name="JOINT_RIGHT_MIDDLE_FINGER_PHALANX_PROXIMAL" value="62" enum="Joint"> + Right middle finger phalanx proximal joint. + </constant> + <constant name="JOINT_RIGHT_MIDDLE_FINGER_PHALANX_INTERMEDIATE" value="63" enum="Joint"> + Right middle finger phalanx intermediate joint. + </constant> + <constant name="JOINT_RIGHT_MIDDLE_FINGER_PHALANX_DISTAL" value="64" enum="Joint"> + Right middle finger phalanx distal joint. + </constant> + <constant name="JOINT_RIGHT_MIDDLE_FINGER_TIP" value="65" enum="Joint"> + Right middle finger tip joint. + </constant> + <constant name="JOINT_RIGHT_RING_FINGER_METACARPAL" value="66" enum="Joint"> + Right ring finger metacarpal joint. + </constant> + <constant name="JOINT_RIGHT_RING_FINGER_PHALANX_PROXIMAL" value="67" enum="Joint"> + Right ring finger phalanx proximal joint. + </constant> + <constant name="JOINT_RIGHT_RING_FINGER_PHALANX_INTERMEDIATE" value="68" enum="Joint"> + Right ring finger phalanx intermediate joint. + </constant> + <constant name="JOINT_RIGHT_RING_FINGER_PHALANX_DISTAL" value="69" enum="Joint"> + Right ring finger phalanx distal joint. + </constant> + <constant name="JOINT_RIGHT_RING_FINGER_TIP" value="70" enum="Joint"> + Right ring finger tip joint. + </constant> + <constant name="JOINT_RIGHT_PINKY_FINGER_METACARPAL" value="71" enum="Joint"> + Right pinky finger metacarpal joint. + </constant> + <constant name="JOINT_RIGHT_PINKY_FINGER_PHALANX_PROXIMAL" value="72" enum="Joint"> + Right pinky finger phalanx proximal joint. + </constant> + <constant name="JOINT_RIGHT_PINKY_FINGER_PHALANX_INTERMEDIATE" value="73" enum="Joint"> + Right pinky finger phalanx intermediate joint. + </constant> + <constant name="JOINT_RIGHT_PINKY_FINGER_PHALANX_DISTAL" value="74" enum="Joint"> + Right pinky finger phalanx distal joint. + </constant> + <constant name="JOINT_RIGHT_PINKY_FINGER_TIP" value="75" enum="Joint"> + Right pinky finger tip joint. + </constant> + <constant name="JOINT_MAX" value="76" enum="Joint"> + Represents the size of the [enum Joint] enum. + </constant> + <constant name="JOINT_FLAG_ORIENTATION_VALID" value="1" enum="JointFlags" is_bitfield="true"> + The joint's orientation data is valid. + </constant> + <constant name="JOINT_FLAG_ORIENTATION_TRACKED" value="2" enum="JointFlags" is_bitfield="true"> + The joint's orientation is actively tracked. May not be set if tracking has been temporarily lost. + </constant> + <constant name="JOINT_FLAG_POSITION_VALID" value="4" enum="JointFlags" is_bitfield="true"> + The joint's position data is valid. + </constant> + <constant name="JOINT_FLAG_POSITION_TRACKED" value="8" enum="JointFlags" is_bitfield="true"> + The joint's position is actively tracked. May not be set if tracking has been temporarily lost. + </constant> + </constants> +</class> diff --git a/doc/classes/XRServer.xml b/doc/classes/XRServer.xml index 09e14f1b21..671cc8f15c 100644 --- a/doc/classes/XRServer.xml +++ b/doc/classes/XRServer.xml @@ -10,6 +10,14 @@ <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> </tutorials> <methods> + <method name="add_body_tracker"> + <return type="void" /> + <param index="0" name="tracker_name" type="StringName" /> + <param index="1" name="body_tracker" type="XRBodyTracker" /> + <description> + Registers a new [XRBodyTracker] that tracks the joints of a body. + </description> + </method> <method name="add_face_tracker"> <return type="void" /> <param index="0" name="tracker_name" type="StringName" /> @@ -66,6 +74,19 @@ Finds an interface by its [param name]. For example, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it. </description> </method> + <method name="get_body_tracker" qualifiers="const"> + <return type="XRBodyTracker" /> + <param index="0" name="tracker_name" type="StringName" /> + <description> + Returns the [XRBodyTracker] with the given tracker name. + </description> + </method> + <method name="get_body_trackers" qualifiers="const"> + <return type="Dictionary" /> + <description> + Returns a dictionary of the registered body trackers. Each element of the dictionary is a tracker name mapping to the [XRBodyTracker] instance. + </description> + </method> <method name="get_face_tracker" qualifiers="const"> <return type="XRFaceTracker" /> <param index="0" name="tracker_name" type="StringName" /> @@ -137,6 +158,13 @@ Returns a dictionary of trackers for [param tracker_types]. </description> </method> + <method name="remove_body_tracker"> + <return type="void" /> + <param index="0" name="tracker_name" type="StringName" /> + <description> + Removes a registered [XRBodyTracker]. + </description> + </method> <method name="remove_face_tracker"> <return type="void" /> <param index="0" name="tracker_name" type="StringName" /> @@ -179,6 +207,26 @@ </member> </members> <signals> + <signal name="body_tracker_added"> + <param index="0" name="tracker_name" type="StringName" /> + <param index="1" name="body_tracker" type="XRBodyTracker" /> + <description> + Emitted when a new body tracker is added. + </description> + </signal> + <signal name="body_tracker_removed"> + <param index="0" name="tracker_name" type="StringName" /> + <description> + Emitted when a body tracker is removed. + </description> + </signal> + <signal name="body_tracker_updated"> + <param index="0" name="tracker_name" type="StringName" /> + <param index="1" name="body_tracker" type="XRBodyTracker" /> + <description> + Emitted when an existing body tracker is updated. + </description> + </signal> <signal name="face_tracker_added"> <param index="0" name="tracker_name" type="StringName" /> <param index="1" name="face_tracker" type="XRFaceTracker" /> |