Merge branch 'main' into proper-getting-started
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Protocol",
|
||||
"position": 2
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Client",
|
||||
"position": 2
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
# Initial Client Connection
|
||||
@@ -1,78 +0,0 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Protocol
|
||||
|
||||
## Data
|
||||
Every message uses [flatbuffers](https://google.github.io/flatbuffers/) and [flexbuffers](https://google.github.io/flatbuffers/flexbuffers.html) to add variant data such as method arguments and return values. The Stardust XR Message schema is:
|
||||
|
||||
```cpp
|
||||
namespace StardustXR;
|
||||
|
||||
table Message {
|
||||
type: ubyte;
|
||||
id: uint;
|
||||
object: string;
|
||||
method: string;
|
||||
error: string;
|
||||
data:[ubyte] (flexbuffer);
|
||||
}
|
||||
|
||||
root_type Message;
|
||||
```
|
||||
|
||||
## Message Types
|
||||
All fields not accounted for are assumed to be not included or `0` or `""`
|
||||
|
||||
### Error
|
||||
|
||||
| Field Name | Value |
|
||||
|-:|:-|
|
||||
| `type` | `0` |
|
||||
| `id` | `0` or ID of method call |
|
||||
| `object` | Path to the object the error comes from |
|
||||
| `method` | What method caused the error (if applicable, otherwise this is an empty string) |
|
||||
| `error` | String containing the error message itself |
|
||||
| `data` | Empty vector |
|
||||
|
||||
### Signal
|
||||
Signals are method calls that do not expect a response of any kind.
|
||||
|
||||
| Field Name | Value |
|
||||
|-:|:-|
|
||||
| `type` | `1` |
|
||||
| `object` | Path to object to send signal to |
|
||||
| `method` | Name of the method to execute |
|
||||
| `data` | Flexbuffer containing arguments to pass to remote method |
|
||||
|
||||
### Method Call
|
||||
Method calls allow for remote procedure calling.
|
||||
|
||||
| Field Name | Value |
|
||||
|-:|:-|
|
||||
| `type` | `2` |
|
||||
| `id` | Dynamically generated ID to identify method return for this method |
|
||||
| `object` | Path to object to execute method on |
|
||||
| `method` | Name of the method to execute |
|
||||
| `data` | Flexbuffer containing arguments to pass to remote method |
|
||||
|
||||
### Method Return
|
||||
Message to pass the return value back to the program.
|
||||
|
||||
| Field Name | Value |
|
||||
|-:|:-|
|
||||
| `type` | `3` |
|
||||
| `id` | The same as the message call's ID |
|
||||
| `data` | Flexbuffer containing return value |
|
||||
|
||||
## Data Types
|
||||
Stardust does not support the `Map` or `FixedTypedVector` flexbuffers datatypes.
|
||||
### Color
|
||||
A `Vector` of 4 `float` is treated as a `Color` in the form `RGBA`.
|
||||
### Vector2
|
||||
A `Vector` of 2 `double` is treated as a `Vector2`.
|
||||
### Vector3
|
||||
A `Vector` of 3 `double` is treated as a `Vector3`.
|
||||
### Quaternion
|
||||
A `Vector` of 4 `double` is treated as a `Quaternion`.
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Server",
|
||||
"position": 3
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Server Objects",
|
||||
"position": 2
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
# /drawable
|
||||
|
||||
Object managing anything drawable, from the skytex to models.
|
||||
|
||||
## Signals
|
||||
### `createModelFromFile(string name, string spacePath, string path)`
|
||||
Creates a new [Model](../types/Model.md) at `/model/[name]` with parent at `spacePath`.
|
||||
|
||||
### `setSkytex(string path)`
|
||||
Sets the sky texture to be the image (HDR) at the absolute `path`.
|
||||
|
||||
### `setSkylight(string path)`
|
||||
Sets the ambient lighting (using spherical harmonics) to the HDR at the absolute `path`.
|
||||
@@ -1,13 +0,0 @@
|
||||
# /field
|
||||
|
||||
Object managing fields for interaction.
|
||||
|
||||
## Signals
|
||||
### `createBoxField(string name, string spacePath, Vector3 origin, Quaternion orientation, Vector3 size)`
|
||||
Creates a new [BoxField](../types/field/BoxField.md) at `/field/[name]` with parent at `spacePath`.
|
||||
|
||||
### `createCylinderField(string name, string spacePath, Vector3 origin, Quaternion orientation, float length, float radius)`
|
||||
Creates a new [CylinderField](../types/field/CylinderField.md) at `/field/[name]` with parent at `spacePath`.
|
||||
|
||||
### `createSphereField(string name, string spacePath, Vector3 origin, float radius)`
|
||||
Creates a new [SphereField](../types/field/SphereField.md) at `/field/[name]` with parent at `spacePath`.
|
||||
@@ -1,9 +0,0 @@
|
||||
# /hmd
|
||||
|
||||
Reference object to the HMD being used to render content and track head position. This does not currently work, but is planned to.
|
||||
|
||||
<!-- ## Signals -->
|
||||
<!-- ### `setPosition(Vector3 position)` -->
|
||||
<!-- ### `setRotation(Quaternion rotation)` -->
|
||||
<!-- ### `setPose(Vector3 position, Quaternion rotation)` -->
|
||||
<!-- ### `setIPD(double meters)` -->
|
||||
@@ -1,16 +0,0 @@
|
||||
# /input
|
||||
|
||||
Object managing input and interaction.
|
||||
|
||||
## Signals
|
||||
<!-- ### `registerPointerInput(string name, Vector3 origin, Vector3 direction, float tilt)` -->
|
||||
<!-- Creates a new [PointerInput](../types/input/inputtypes/PointerInput.fbs) at `/input/methods/[name]` with the origin, direction, and tilt specified. -->
|
||||
|
||||
### `registerInputHandler(string name, string field, string spacePath, Vector3 position, Quat rotation, string callbackPath, string callbackMethod)`
|
||||
Creates a new [InputHandler](../types/input/InputHandler.md) with the specified `name` and `field`, located relative to the space referenced in `spacePath` and the `postion` + `rotation`.
|
||||
|
||||
|
||||
## Methods
|
||||
|
||||
### `Vector<Vector<string inputHandlerUUID, Vector3 position>> getInputHandlers(string spacePath, bool excludeSelf)`
|
||||
Returns a list of all [InputHandler](../types/input/InputHandler.md) UUIDs and their positions (relative to the space at `spacePath`), as well as puts aliases to those handlers in `/input/global_handler/[UUID]`. Excludes handlers from this client if `excludeSelf` is true.
|
||||
@@ -1,14 +0,0 @@
|
||||
# /
|
||||
|
||||
Object managing the client/server relationship as a whole.
|
||||
|
||||
## Signals
|
||||
### `subscribeLogicStep(string path, string method)`
|
||||
Executes `method` on object at `path` on the client when the main logic loop of the server starts each frame.
|
||||
|
||||
`method` must have arguments of `(double delta, double timeToRender)`.
|
||||
|
||||
`delta` gives the time in seconds between the current time and the last time the logic loop executed while `timeToRender` gives the time in ms since epoch when the current frame is expected to reach the user's eyes (returns 0 for now).
|
||||
|
||||
### `disconnect(null)`
|
||||
Lets the server know that the client wishes to disconnect. After this it can be assumed the client is disconnected from the server.
|
||||
@@ -1,10 +0,0 @@
|
||||
# /spatial
|
||||
|
||||
Object managing spatial objects and spatial manipulation.
|
||||
|
||||
## Signals
|
||||
### `createSpatial(string name, string spacePath, Vector3 origin, Quat orientation, Vector3 scale, bool translatable, bool rotatable, bool scalable)`
|
||||
Creates a new [Spatial](../types/Spatial.md) at `/spatial/spatial/[name]` with parent at `spacePath`.
|
||||
|
||||
### `createZone(string name, string fieldPath, string spacePath, Vector3 origin, Quat orientation, string callbackPath, string callbackMethod)`
|
||||
Creates a new [Zone](../types/Zone.md) at `/spatial/zone/[name]` with parent at `spacePath` and field at `fieldPath`. The arguments `callbackPath` and `callbackMethod` refer to a callback method accepting a `Vector` of 2 `TypedVector`s, the first being a list of names of nodes that have just entered the field and the second being names of nodes that left (as `string`).
|
||||
@@ -1,41 +0,0 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
# Model
|
||||
### Derived from [Spatial](Spatial)
|
||||
A graphical model. It will only show when enabled.
|
||||
|
||||
## Properties
|
||||
|
||||
### `setVisible(bool visible)`
|
||||
Enables/disables visibility.
|
||||
|
||||
### `setOrigin(Vector3 origin)`
|
||||
Sets the origin to `origin`.
|
||||
|
||||
### `setOrientation(Quat orientation)`
|
||||
Sets the orientation to `orientation`.
|
||||
<!-- -->
|
||||
<!-- ### `setPose(Vector3 origin, Quat orientation)` -->
|
||||
<!-- Sets the pose using `origin` and `orientation` absolutely. -->
|
||||
|
||||
### `destroy()`
|
||||
Destroys the model instance. Resources like the mesh and material and textures may be in memory still, but the resource manager will clean it up if needed.
|
||||
|
||||
### `setMaterialProperty(uint32 submeshIndex, string propertyName, float value)`
|
||||
### `setMaterialProperty(uint32 submeshIndex, string propertyName, Color value)`
|
||||
### `setMaterialProperty(uint32 submeshIndex, string propertyName, string value)`
|
||||
Sets the material property `propertyName` on this model's submesh at `submeshIndex` to `value`. Valid material names are:
|
||||
|
||||
| Name | Type | Description |
|
||||
|--------------|--------------|----------------------------------------------------------------------------------------------|
|
||||
|`color` | `Color` | Tint/multiply the shader's output color by this amount. (default is opaque white) |
|
||||
|`roughness` | `float` | Scale the metal texture's roughness by this amount |
|
||||
|`metallic` | `float` | Scale the metal texture's metalness by this amount |
|
||||
|`tex_scale` | `float` | Scale the UV coordinates of all textures by this amount |
|
||||
|`diffuse` | `string` | Path to the diffuse texture of the material (if it has one). |
|
||||
|`emission` | `string` | Path to the emission texture of the material (if it has one). |
|
||||
|`metal` | `string` | Path to the metalness texture of the material (if it has one). |
|
||||
|`normal` | `string` | Path to the normal map texture of the material (if it has one). |
|
||||
|`occlusion` | `string` | Path to the occlusion map texture of the material (if it has one). |
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Node
|
||||
A base type for all other types that exist in 3D space.
|
||||
|
||||
## Methods
|
||||
### `destroy()`
|
||||
Destroy this node immediately, as well as all its children if it has any.
|
||||
|
||||
### `setEnabled(bool enabled)`
|
||||
Set if this node is enabled or not, for example a disabled model will not render and a disabled input handler will not recieve input.
|
||||
@@ -1,56 +0,0 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# Spatial
|
||||
### Derived from [Node](Node)
|
||||
A base type for types that exist in 3D space, always relative to another space or the engine's world space. Spatials are always relative because in AR or XXR reference spaces change constantly in response to new environments.
|
||||
|
||||
## Internal Properties
|
||||
Sometimes it makes sense for a Spatial to not be scalable (like in [Fields](field/Field) where scaling dramatically increases the number of steps to raymarch for pointers) or not be rotatable (point lights) or such, so these are disabled for certain Spatial-derived objects, mentioned right after "Derived from [Spatial](Spatial)".
|
||||
### `translatable: bool`
|
||||
If false, object's origin cannot be modified from a client.
|
||||
### `rotatable: bool`
|
||||
If false, object's rotation cannot be modified from a client (e.g. point lights, point sound sources).
|
||||
### `scalable: bool`
|
||||
If false, object's scale cannot be modified from a client (e.g. [Fields](field/Field), [PointerInput](input/inputtypes/PointerInput.md)).
|
||||
### `zoneable: bool`
|
||||
If false, no zones will see that this spatial exists. Useful for locking objects in space so they aren't affected by workspaces and generally shouldn't be true for anything other than the root spatial of an object.
|
||||
|
||||
## Signals
|
||||
### `move(Vector3 position)`
|
||||
Moves the Spatial relative to itself if `translatable` is not `false`.
|
||||
|
||||
### `rotate(Quat rotation)`
|
||||
Rotates the Spatial relative to itself if `rotatable` is not `false`.
|
||||
|
||||
### `scale(float scale)`
|
||||
Multiplies the Spatial's scale vector by `scale` if `scalable` is not `false`.
|
||||
|
||||
### `setOrigin(Vector3 origin)`
|
||||
Sets the origin to `origin` if `translatable` is not `false`.
|
||||
|
||||
### `setOrientation(Quat orientation)`
|
||||
Sets the orientation to `orientation` if `rotatable` is not `false`.
|
||||
|
||||
### `setScale(Vector3 scale)`
|
||||
Sets the scale to `scale` if `scalable` is not `false`.
|
||||
|
||||
### `setPose(Vector3 origin, Quat orientation)`
|
||||
Sets the pose relative to the Spatial's space if `translatable` and `rotatable` are true. This method saves on IPC calls compared to `setOrigin` and `setOrientation` in sequence.
|
||||
|
||||
### `setTransform(Vector3 origin, Quat orientation)`
|
||||
Sets the transform relative to the Spatial's space if `translatable`, `rotatable` and `scalable` are true. This method saves on IPC calls compared to `setOrigin`, `setOrientation`, and `setScale` in sequence.
|
||||
|
||||
### `setSpatialParent(string parentPath)`
|
||||
Sets the spatial parent of this `Spatial` while keeping the object in the same place in local space.
|
||||
|
||||
### `setSpatialParentInPlace(string parentPath)`
|
||||
Sets the spatial parent of this `Spatial` while not changing the object's absolute position.
|
||||
|
||||
### `setZoneable(bool zoneable)`
|
||||
Enable/disable this spatial's zoneable property.
|
||||
|
||||
## Methods
|
||||
### `Vector<Vector3 origin, Quat orientation, Vector3 scale> getTransform(null)`
|
||||
Returns the `origin`, `orientation`, and `scale` of this spatial relative to its parent.
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
sidebar_position: 9
|
||||
---
|
||||
|
||||
# Zone
|
||||
### Derived from [Spatial](Spatial)
|
||||
An object to manipulate compatible [Spatials](Spatial) inside its field, such as organizing/aligning widgets or creating workspaces, acting as an inertial reference frame or part of a multi-selection wand.
|
||||
|
||||
|
||||
## Signals
|
||||
### `bool isCaptured(string spatialUUID)`
|
||||
Returns `true`/`false` if the [Spatial](Spatial) is captured by this zone or another, `null` if the [Spatial](Spatial) at `spatialUUID` is not accessible by this zone or does not exist.
|
||||
|
||||
### `capture(string spatialUUID)`
|
||||
Captures the [Spatial](Spatial) at `spatialUUID` if that [Spatial](Spatial) exists and is accessible by this zone. This means that the [Spatial](Spatial) cannot be seen or affected by other zones unless a zone is closer to the [Spatial](Spatial) than this zone.
|
||||
|
||||
### `release(string spatialUUID)`
|
||||
Uncaptures the [Spatial](Spatial) at `spatialUUID` so any zone the [Spatial](Spatial) is inside can access it.
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Node Types",
|
||||
"position": 1
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
# BoxField
|
||||
### Derived from [Field](Field)
|
||||
This field is in a rectangular prism shape.
|
||||
|
||||
## Properties
|
||||
### `setSize(Vector3 size)`
|
||||
Sets the size of the box.
|
||||
@@ -1,7 +0,0 @@
|
||||
# CylinderField
|
||||
### Derived from [Field](Field)
|
||||
A cylinder shaped field defined by radius and length, along the forward vector.
|
||||
|
||||
## Properties
|
||||
### `setSize(Vector3 size)`
|
||||
Sets the size of the box.
|
||||
@@ -1,13 +0,0 @@
|
||||
# Field
|
||||
### Derived from [Spatial](../Spatial)
|
||||
Type that contains methods all Fields share. All fields created are under `/field`. See [/field](../../objects/field.md) for the field factory.
|
||||
|
||||
## Methods
|
||||
### `double distance(string spacePath, Vector3 point)`
|
||||
Returns the distance from `point` to the surface of the object, positive if the point is outside and negative if inside. When `point` is far enough away the object will give an approximate distance to the origin instead of the surface.
|
||||
|
||||
### `Vector3 normal(string spacePath, Vector3 point)`
|
||||
Returns the normal of `point` compared to the surface of the object. Normal always points toward object.
|
||||
|
||||
### `Vector3 closestPoint(string spacePath, Vector3 point)`
|
||||
Returns the closest point from `point` to the surface of the object. Use this instead of `distance` and `normal` when best to limit IPC calls.
|
||||
@@ -1,7 +0,0 @@
|
||||
# SphereField
|
||||
### Derived from [Field](Field)
|
||||
This Field is in a sphere shape.
|
||||
|
||||
## Properties
|
||||
### `setRadius(double size)`
|
||||
Sets the radius of the sphere.
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Fields",
|
||||
"position": 4
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
# InputHandler
|
||||
## Derived from [Spatial](../Spatial) (`scalable: false`)
|
||||
|
||||
A handler to allow clients to recieve input. Won't send input through the callback if disabled.
|
||||
|
||||
## Methods
|
||||
### `setField(string field)`
|
||||
Sets the field this input handler will use.
|
||||
|
||||
### `setCallback(string callbackPath, string callbackMethod)`
|
||||
Sets the callback this input handler will use.
|
||||
|
||||
### `setActions(Vector<String> actions)`
|
||||
Specify all compatible action names (human-readable).
|
||||
|
||||
### `Vector<String> getActions(null)`
|
||||
Get a list of all action names (human-readable).
|
||||
|
||||
### `setActions(Vector<String> actions)`
|
||||
Set all the objects on this input handler to `actions`.
|
||||
|
||||
### `runAction(String actionName)`
|
||||
Runs the action specififed by `actionName`.
|
||||
@@ -1,51 +0,0 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
# InputMethod
|
||||
## Derived from [Spatial](../Spatial.md) (`scalable: false`)
|
||||
Represents an input device generically, with specifics being fleshed out in subclasses.
|
||||
|
||||
## Internal Properties
|
||||
### `type: uint8`
|
||||
| | Name | Description |
|
||||
|---|--------------|-------------------------------------------------------------------------------------------------------------|
|
||||
| 0 | `Global` | A non-spatial input, used for power buttons and system volume and such |
|
||||
| 1 | `Controller` | Contains a pose and datamap for buttons, trackpad, joystick, grip, trigger, etc. |
|
||||
| 2 | [`PointerInput`](inputtypes/PointerInput.md) | Defined by origin, direction, and tilt with datamap for buttons, trackpad, etc. |
|
||||
| 3 | [`HandInput`](inputtypes/HandInput.md) | Contains a full 27-bone hand skeleton (including forearm) and datamap for abstractions like grip, pinch distance/point, etc. |
|
||||
|
||||
### `datamap: Dictionary`
|
||||
See [Datamap:](#datamap)
|
||||
|
||||
## Internal Methods
|
||||
### `distanceToField(string field)`
|
||||
Returns the distance from this input to a field in meters. `field` is the name of the field, not the full path.
|
||||
|
||||
### `serialize()`
|
||||
Returns a serialized version of the InputMethod, each serialized schema is shown under #Serialization in the respective Input subclasses.
|
||||
|
||||
## Serialization
|
||||
| Key | Value Type |
|
||||
|-----------|-------------|
|
||||
| type | `int` |
|
||||
| distance | `float` |
|
||||
|
||||
## Datamap
|
||||
The datamap is a dictionary containing abstracted and raw data related to the input that clients can use to analyze input in the most optimal way. It has keys of type `Key`(Flexbuffers-specific, in any other language use a `String`) and values:
|
||||
|
||||
| Type | Example Uses | Usage Notes |
|
||||
|-----------|----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `bool` | Digital buttons | If values are analog, use a `float` instead with `1.0` being considered `true`. |
|
||||
| `float` | Analog trigger, grip | For values such as grip/trigger, make the range `0.0`-`1.0`, for something like a scroll wheel `-0.5`-`0.5`. |
|
||||
| `Vector2` | Touchpad, joystick | For values such as trackpad and joystick, make each component in the range of `-0.5`-`0.5` and calculate+apply deadzone before setting these values. |
|
||||
| `Vector3` | Pinch position, grip axis vector | For points and directions, make this a value inside the InputMethod's local space. Raw hand pose data should not be put in the datamap. |
|
||||
| `string` | Input device type/name | Device name such as `"valveindex"` and device type such as `"controller"` on a PointerInput. Useful for client devs to customize input to work best with these devices. |
|
||||
|
||||
Standard supported datamap keys will be put in the individual type's documentation, however you can put more data in and some input handlers may be able to use that data for better interactions.
|
||||
|
||||
## Methods
|
||||
<!-- ### `setPosition(Vector3 point)` -->
|
||||
<!-- Sets the position of this [InputMethod](../input/InputMethod). This pose also defines the main interaction point. -->
|
||||
|
||||
### `modifyDatamap(Dictionary data)`
|
||||
Merges the datamap of this [InputMethod](InputMethod) with `data`. Each key here will add to the datamap if not present and set the existing value if present. Any key not present in `data` will be unaffected.
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Input",
|
||||
"position": 5
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
# HandInput
|
||||
|
||||
### Derived from [InputMethod](../InputMethod)
|
||||
|
||||
A full 27-bone hand+forearm input with useful abstractions provided through the datamap.
|
||||
|
||||
The local space of a hand is where +Z is away from the palm, +Y is from the palm to the fingers, and +X is orthogonal and to the right.
|
||||
|
||||
## Serialization
|
||||
|
||||
| Key | Value Type |
|
||||
|-----------|--------------|
|
||||
| origin | `Vector3` |
|
||||
| direction | `Vector3` |
|
||||
| tilt | `float` |
|
||||
| datamap | `Dictionary` |
|
||||
|
||||
```js
|
||||
[
|
||||
thumb metacarpal,
|
||||
thumb proximal,
|
||||
thumb distal,
|
||||
thumb tip,
|
||||
index metacarpal,
|
||||
index proximal,
|
||||
index intermediate,
|
||||
index distal,
|
||||
index tip,
|
||||
middle metacarpal,
|
||||
middle proximal,
|
||||
middle intermediate,
|
||||
middle distal,
|
||||
middle tip,
|
||||
ring metacarpal,
|
||||
ring proximal,
|
||||
ring intermediate,
|
||||
ring distal,
|
||||
ring tip,
|
||||
little metacarpal,
|
||||
little proximal,
|
||||
little intermediate,
|
||||
little distal,
|
||||
little tip
|
||||
]
|
||||
```
|
||||
|
||||
(This section is WIP)
|
||||
|
||||
## Datamap
|
||||
|
||||
### Required
|
||||
|
||||
| Key | Value Type | Description |
|
||||
|-----------------|-----------------------------|--------------------------------------------------------------------|
|
||||
| confidence | `float` (range `0.0`-`1.0`) | How confident the hand tracker is of the pose of the hand |
|
||||
| isLeft | `bool` | `true` if this hand is the left hand, `false` if not |
|
||||
| pinchStrength | `float` (range `0.0`-`1.0`) | How much the hand is pinching |
|
||||
| pinchDistance | `float` (>`0.0`) | The distance in meters between the thumb and index finger |
|
||||
| grabStrength | `float` (range `0.0`-`1.0`) | How much the hand is making a fist |
|
||||
|
||||
## Methods
|
||||
|
||||
**TODO**: Properly secured field distance calculation accessible to clients
|
||||
@@ -1,37 +0,0 @@
|
||||
# PointerInput
|
||||
### Derived from [InputMethod](../InputMethod)
|
||||
|
||||
An input method for pointers, such as the Daydream's remote, a pointer put on an Index controller, Oculus style laser mouse, and your desktop's mouse in flatscreen.
|
||||
|
||||
The local space for a pointer is where +Z is along the pointer's direction, +X is to the right of the pointer when laying face up, and +Y is upward when laying face up.
|
||||
|
||||
## Serialization
|
||||
| Key | Value Type |
|
||||
|-----------|--------------|
|
||||
| origin | `Vector3` |
|
||||
| direction | `Vector3` |
|
||||
| tilt | `float` |
|
||||
| datamap | `Dictionary` |
|
||||
|
||||
## Datamap
|
||||
### Required
|
||||
| Key | Value Type | Description |
|
||||
|--------|-------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| select | `float` (range `0.0`-`1.0`) | Whether the pointer is attempting to select an object, usually through trigger. 1.0 is selected, 0.0 is not selected, and inbetween is to add smoothness to the interaction. |
|
||||
| grab | `float` (range `0.0`-`1.0`) | How much the pointer is attempting to grab an object. 0.0 is not grabbing at all, 1.0 is grabbing the strongest, and inbetween is to add smoothness. |
|
||||
| scroll | `Vector2` (component range `-0.5`-`0.5`) | The amount to scroll on this input tick (sensitivity determined on the receiving client). Can be used for 2D scrolling as well as adjusting depth/size when grabbing an object. |
|
||||
### Built in
|
||||
| Key | Value Type | Description |
|
||||
|--------|--------------|-----------------------------------------------------------|
|
||||
| deepestPointDistance | `float` (>=`0.0`) | The distance along the ray where the deepest surface point resides. |
|
||||
| type | `string` | The type of pointer. Can be one of `"eyes"`, `"mouse"`, `"controller"`, `"gaze"`, `"generic"` |
|
||||
|
||||
## Methods
|
||||
### `setDirection(Vector3 direction)`
|
||||
Sets the direction the pointer is pointing in stage space.
|
||||
### `setTilt(float angle)`
|
||||
Sets the tilt of the pointer (rotation about the pointer direction) clockwise in radians.
|
||||
### `setOrientation(Vector3 direction, float angle)`
|
||||
Sets the direction and tilt of the pointer to save on IPC calls.
|
||||
### `setPose(Vector3 origin, Vector3 direction, float angle)`
|
||||
Sets the origin, direction, and tilt of the pointer to save on IPC calls.
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Input Method Types",
|
||||
"position": 3
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Item",
|
||||
"position": 6
|
||||
}
|
||||
Reference in New Issue
Block a user