XRC Sphere Select
Overview
This package is an implementation of the selection technique seen in the Gravity Sketch application. The technique, here called Sphere Select, is built using Unity's XR Interaction Toolkit.
Components
Sphere Select
This component contains the main logic for the Sphere Select interaction technique. It holds a reference to an interactor responsible for selecting the object of interest. The Sphere Select technique modifies the interactor's attach transform, as well as its collider, based on the Sphere Select property values.
Property | Description |
---|---|
Interactor | The interactor responsible for selecting an object. If the interactor reference is not assigned in the inspector, the Sphere Select component will search for the appropriate component on the same game object. |
Offset | The positional offset of the sphere, relative to the interactor's transform. This value is used to update the interactor's attach transform. |
Min Radius | The minimum radius of the sphere. |
Max Radius | The maximum radius of the sphere. |
Sphere Select Input
This component handles the user input, and passes the corresponding values to the Sphere Select component.
Property | Description |
---|---|
Input Sensitivity | The scale factor applied to the user input when determining the radius value. |
Change Radius Action | The input action property associated with changing the radius of the of sphere. |
Sphere Select Feedback
This component renders a sphere based on the properties of the Sphere Select component, such as radius and offset. The component provides feedback based on the interactor's hover and select events by changing the color of the sphere to Hover Color and by not rendering the sphere, respectively. This is done by adding listeners to Sphere Select's interactor hover and select events. When the interactor is neither hovering nor selecting, the sphere color is set to Color.
Property | Description |
---|---|
Color | Color of the sphere when the interactor is not hovering over any object. |
Hover Color | Color of the sphere when the interactor is hovering over an object. |
Installation instructions
To install this package, follow these steps:
- In the Unity Editor, click on Window > Package Manager
- Click the + button and choose Add package from git URL option
- Paste the URL to the package repository: https://github.com/xrcollaboratory/edu.cornell.xrc.interaction.sphereselect.git in the prompt and click on Add (make sure your URL ends with ".git")
- If the repository is private, you will be asked to authenticate via your GitHub account. If you haven't been granted access to the repository you will not be able to install the package.
- The package should be installed into your project
- You can download the package samples from under the Samples tab in the Package Manager
Note: Even though the package documentation is public, several XRC packages are private and accessible only to XRC staff and students.
Requirements
This package was developed and tested using the following Unity Editor version:
- 2022.4.7f1 LTS
Dependencies: XRC Core, XR Interaction Toolkit, Input System.
Workflows
When adding the Sphere Select technique to your scene you can do any of the following:
- Add the three Sphere Select components directly on the game object containing the interactor.
- Place the three Sphere Select components on separate object in the scene hierarchy, as shown in the screenshot below. In this case the interactor reference must be assigned in the inspector.
Samples
XRC Sphere Select
A sample showcasing the Sphere Select implementation.