Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebXR Detected Meshes API #9182

Merged
merged 13 commits into from Nov 2, 2023
Merged

WebXR Detected Meshes API #9182

merged 13 commits into from Nov 2, 2023

Conversation

HexaField
Copy link
Member

@HexaField HexaField commented Oct 31, 2023

Summary

🤖 Generated by Copilot at aa18e22

This pull request enhances the XR functionality and UI of the engine and the client, by adding mesh detection, improving scene placement, fixing input issues, and adding a hand preference widget. It also cleans up some unused or temporary code, and fixes a network ID bug. It modifies several files in packages/engine/src/xr, packages/engine/src/input, packages/engine/src/transform, packages/engine/src/scene, and packages/engine/src/networking, and adds or deletes some components and systems. It also updates the packages/client-core and packages/client packages to use SVG icons and local transforms for the UI.

References

closes #insert number here

Explanation

🤖 Generated by Copilot at aa18e22

  • Add HandednessWidgetButton component to toggle the preferred hand setting and show the hand icon and label in the widget menu (link, link, link, link, link, link, link, link, link)
  • Use LocalTransformComponent and EntityTreeComponent for input source entities and widget menu entity to enable local positioning and entity tree relationship (link, link, link, link, link, link, link)
  • Replace inputComponent with inputComponent.source to access the gamepad properties of the input source directly (link, link)
  • Replace flipped variable with XRStandardGamepadAxes enum values to use the correct axes for the thumbstick input regardless of the handedness (link, link)
  • Add deltaSeconds factor to the yDelta calculation to scale the scene scale target change by the time delta (link)
  • Remove the call to dispatchAction to disable the widget in the createAnchorWidget function, as this is handled by the WidgetUISystem instead (link)
  • Add capture and release methods to the InputSourceComponent to provide convenience methods for capturing and releasing both buttons and axes for an input source (link)
  • Add optional chaining operator to the inputSourceComponent variable in the isAxesCaptured method of the InputSourceComponent to handle the case when the input source entity does not have the component (link)
  • Replace ReferenceSpace.origin with ReferenceSpace.localFloor for getting the pose of the active input source, to align the widget menu with the local floor level (link)
  • Remove the multiplication by the inverseWorldScale in the updateScenePlacement, updateCameraFromXRViewerPose, and XRCameraSystem functions, to use the local position instead of the world position for the scene placement, camera transform, and view camera position (link, link, link)
  • Replace userID with peerID in the sendOutgoingActions function, to use the peer ID instead of the user ID for identifying the host of the network (link)
  • Add mesh-detection feature to the optionalFeatures array in the setupXRSession function, to request the mesh detection feature from the XR session (link)
  • Add XRDetectedMeshComponent and XRDetectedMeshSystem to define a component and a system for XR detected meshes and their associated meshes and geometries (link, link)
  • Remove XRPlaneComponent and XRDetectedPlanesSystem and replace them with XRDetectedPlaneComponent to define a component for XR detected planes and their associated meshes and geometries (link, link, link, link)
  • Remove unused imports and variables from various files to clean up the code (link, link, link, link, link, link)
  • Add comments to the onSet methods of the TransformComponent and the LocalTransformComponent to indicate that the code is temporary until issue Physics system should handle creation and destruction of physics objects, not component reactors #9193 is resolved (link, link)
  • Rename the entity parameter to targetEntity in the captureButtons and captureAxes methods of the InputSourceComponent to clarify the meaning of the parameter (link, link)
  • Uncomment the useEffect hook in the reactor function in XRAnchorSystem to enable the capturing of axes and buttons for the scene placement entity, and add the capturing of buttons as well (link)
  • Add an export keyword to the XRAnchorSystemState to make the state accessible from other modules (link)
  • Remove the entire file packages/engine/src/xr/XRDetectedPlanesSystem.ts as it is no longer used (link)

🤖 Generated by Copilot at aa18e22

Sing, O Muse, of the mighty feats of code
That the skilled developers wrought with their hands
To enhance the engine of XR and SVG
And to fix the bugs that plagued the virtual lands

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

Checklist

  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • ensure all checks pass
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewers

@HexaField HexaField marked this pull request as draft October 31, 2023 20:19
@HexaField HexaField marked this pull request as ready for review November 2, 2023 23:44
@HexaField HexaField merged commit b8f6b3d into dev Nov 2, 2023
13 checks passed
@HexaField HexaField deleted the webxr-detected-meshes-api branch November 2, 2023 23:44
if (!hasComponent(widgetMenuUI.entity, ComputedTransformComponent))
if (!hasComponent(widgetMenuUI.entity, ComputedTransformComponent)) {
removeComponent(widgetMenuUI.entity, EntityTreeComponent)
removeComponent(widgetMenuUI.entity, LocalTransformComponent)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow breaking setComputedTransformComponent

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically removing EntityTreeComponent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants