stalgiag / p5.xr

a library that helps turn p5.js sketches into immersive experiences using WebXR
GNU Lesser General Public License v2.1
117 stars 25 forks source link

Controller model representation #174

Open smrghsh opened 1 year ago

smrghsh commented 1 year ago

Nature of issue?

Which area does this problem relate to?

New feature details:

Improved Controller Representation

The following four are crucial XR features where ease of implementation benefits prototyping speed and removes barriers to development. I have listed commonly accessed properties and calculations that must be performed.

  1. Navigating menus with raycasting - Controller position and orientation, Primary button access
  2. Teleporting - Controller position and orientation, Joystick access, secondary button access
  3. Grabbing - Controller grip button or secondary button access, Controller orientation
  4. Physics based interactions -Controller speed, controller acceleration

Challenges

Devices have varying implementations and real-life appearances— Therefore, the controller representation would benefit from a single visual virtual representation and wrapper API. In an ideal world, this would mimic the simplicity of p5’s globally scoped mouse position.

p5.xr must account for intermittent device connection — This is a challenging one, as p5.xr should be usable by those without intermediate knowledge of error handling. p5 must return a default position for the controllers— so in the interim, I suggest 0,0,0. More advice needed from accessibility experts

Solution

Goal: expanded1

smrghsh commented 1 year ago

@stalgiag Updated with details

stalgiag commented 1 year ago

Great! Thanks for writing this up!

Add more info about the proposed usage once you have a design that you are prepared to move forward with. For example, you mentioned 'the simplicity of p5’s globally scoped mouse position' - what is the equivalent in XR? Also, raycast coords on menus would be most useful as 2D coordinates (much like mouseX and mouseY), how do we provide something simple but useful for this?