You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-11Lines changed: 37 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,32 @@
1
1
# RealityUI
2
2
3
-
RealityUI is a collection of User Interface classes for RealityKit.
4
-
The classes included in RealityUI aim to offer familiar User Interface guidelines, but in a 3D setting for Augmented and Virtual Reality through RealityKit.
3
+
RealityUI is a collection of utilities and UI objects for RealityKit.
4
+
The UI objects included in RealityUI aim to offer familiar User Interface standards, but in a 3D setting for Augmented and Virtual Reality through RealityKit.
5
5
6
-
The User Interface controls in this repository so far are made to be familiar to what people are used to with 2D interfaces, however the plan is to expand the tools on offer to new and unique controls, which are more appropriate for an Augmented Reality and Virtual Reality context.
6
+
RealityUI also has a collection of components for interfacing with any Entity through touch or drag interactions.

@@ -62,7 +70,7 @@ All components used in RealityUI must be registered before they are used, simply
62
70
63
71
Enabling RealityUI gestures can be doen by calling `RealityUI.enableGestures(.all, on: ARView)`, with `ARView` being your instance of an [ARView](https://developer.apple.com/documentation/realitykit/arview) object.
64
72
65
-
RUISlider, RUISwitch, RUIStepper and RUIButton all use `.longTouch`, and if you are adding elements that use the protocol `HasClick` you can use the gesture `.tap`.
73
+
RUISlider, RUISwitch, RUIStepper and RUIButton all use ``RUIDragComponent``, which requires `.ruiDrag`. If you are adding elements that use the component `RUITapComponent` you can use the gesture `.tap`.
66
74
I would just recommend using `.all` when enabling gestures, as these will inevitably move around as RealityUI develops.
67
75
68
76
`RealityUI.enableGestures(.all, on: arView)`
@@ -114,19 +122,37 @@ Default button bounding box before depressing the button into the base is `[1, 1
114
122
115
123
All of the RealityUI Control Entities use custom gestures that aren't standard in RealityKit, but some of them have been isolated so anyone can use them to manipulate their own RealityKit scene.
116
124
125
+
### Drag
126
+
127
+
Drag objects anywhere in space with 3 degrees of freedom with [RUIDragComponent](https://maxxfrazer.github.io/RealityUI/documentation/realityui/RUIDragComponent), using the [.move](https://maxxfrazer.github.io/RealityUI/documentation/realityui/RUIDragComponent/move(_:)) type.
128
+
129
+

130
+
131
+
This type has an optional constraint, to fix the movement within certain criteria:
132
+
133
+
1.**Box Constraint**: Restricts movement within a specified `BoundingBox`, providing a defined area where the entity can move.
134
+
135
+
2.**Points Constraint**: Limits movement to a set of predefined points, represented as an array of `SIMD3<Float>`.
136
+
137
+
3.**Clamp Constraint**: Uses a custom clamping function to control the movement. This function takes a `SIMD3<Float>` as input and returns a modified `SIMD3<Float>` to determine the new position.
138
+
117
139
### Turn
118
140
119
141
Unlock the ability to rotate a RealityKit entity with just one finger.
Create an object in your RealityKit scene with an action, and it will automatically be picked up whenever the user taps on it!
128
150
129
-
No Gif for this one, but check out [RealityUI Gestures wiki](https://github.com/maxxfrazer/RealityUI/wiki/Gestures#tap) to see how to add [HasClick](https://maxxfrazer.github.io/RealityUI/documentation/realityui/HasClick.html) to an entity in your application.
151
+
No Gif for this one, but check out [RUITapComponent](https://maxxfrazer.github.io/RealityUI/documentation/realityui/RUITapComponent) to see how to add this to an entity in your application.
152
+
153
+
If you instead wanted to use something similar to a "touch up inside" tap, you can use [RUIDragComponentType/click](https://maxxfrazer.github.io/RealityUI/documentation/realityui/RUIDragComponent/DragComponentType/click).
154
+
155
+

130
156
131
157
---
132
158
## Animations
@@ -161,6 +187,6 @@ With RUIText you can easily create an Entity with the specified text placed with
161
187
---
162
188
## More
163
189
164
-
More information on everything provided in this Swift Package in the [GitHub Wiki](https://github.com/maxxfrazer/RealityUI/wiki), and also the [documentation](https://maxxfrazer.github.io/RealityUI/documentation/realityui/).
190
+
More information on everything provided in this Swift Package in the [documentation](https://maxxfrazer.github.io/RealityUI/documentation/realityui/).
165
191
166
192
Also see the [Example Project](https://github.com/maxxfrazer/RealityUI/tree/main/RealityUI%2BExamples) for iOS in this repository.
0 commit comments