Many improvements
This commit is contained in:
@@ -7,4 +7,7 @@ Object managing input and interaction.
|
||||
<!-- 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`.
|
||||
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`.
|
||||
|
||||
### `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.
|
||||
@@ -7,14 +7,18 @@ sidebar_position: 3
|
||||
A graphical model.
|
||||
|
||||
## 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.
|
||||
<!-- -->
|
||||
<!-- ### `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.
|
||||
|
||||
@@ -5,6 +5,6 @@ sidebar_position: 1
|
||||
# Node
|
||||
A base type for all other types that exist in 3D space.
|
||||
|
||||
<!-- ## Methods -->
|
||||
<!-- ### `destroy(null)` -->
|
||||
<!-- Destroy this node immediately, as well as all its children if it has any. -->
|
||||
## Methods
|
||||
### `destroy()`
|
||||
Destroy this node immediately, as well as all its children if it has any.
|
||||
@@ -22,9 +22,6 @@ 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`.
|
||||
|
||||
### `rotateAround(Vector3 point, Quat rotation)`
|
||||
Rotates the Spatial around `point` (relative to itself) if `rotatable` is not `false`.
|
||||
|
||||
### `scale(float scale)`
|
||||
Multiplies the Spatial's scale vector by `scale` if `scalable` is not `false`.
|
||||
|
||||
@@ -44,4 +41,7 @@ Sets the pose relative to the Spatial's space if `translatable` and `rotatable`
|
||||
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 "absolute" position in space intact.
|
||||
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.
|
||||
@@ -20,4 +20,16 @@ Sets the pose using `origin` and `orientation` relative to the pose's space.
|
||||
Sets the field this input handler will use.
|
||||
|
||||
### `setCallback(string callbackPath, string callbackMethod)`
|
||||
Sets the callback this input handler will use.
|
||||
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`.
|
||||
@@ -39,6 +39,7 @@ The datamap is a dictionary containing abstracted and raw data related to the in
|
||||
| `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.
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
include "common.fbs";
|
||||
namespace StardustXR;
|
||||
|
||||
table Hand {
|
||||
finger_joints:[joint] (required);
|
||||
|
||||
palm:joint (required);
|
||||
wrist:joint (required);
|
||||
elbow:joint;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
include "PointerInput.fbs";
|
||||
include "HandInput.fbs";
|
||||
namespace StardustXR;
|
||||
|
||||
union InputDataRaw {
|
||||
Pointer,
|
||||
Hand
|
||||
}
|
||||
|
||||
table InputData {
|
||||
input:InputDataRaw (required);
|
||||
distance:float = 0;
|
||||
datamap:[ubyte] (flexbuffer);
|
||||
}
|
||||
|
||||
root_type InputData;
|
||||
@@ -1,8 +0,0 @@
|
||||
include "common.fbs";
|
||||
namespace StardustXR;
|
||||
|
||||
table Pointer {
|
||||
origin:vec3 (required);
|
||||
direction:vec3 (required);
|
||||
tilt:float = 0;
|
||||
}
|
||||
@@ -22,8 +22,9 @@ The local space for a pointer is where +Z is along the pointer's direction, +X i
|
||||
| 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)`
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
namespace StardustXR;
|
||||
|
||||
struct vec3 {
|
||||
x:float;
|
||||
y:float;
|
||||
z:float;
|
||||
}
|
||||
|
||||
struct quat {
|
||||
w:float;
|
||||
x:float;
|
||||
y:float;
|
||||
z:float;
|
||||
}
|
||||
|
||||
struct pose {
|
||||
position:vec3;
|
||||
rotation:quat;
|
||||
}
|
||||
|
||||
struct joint {
|
||||
position:vec3;
|
||||
rotation:quat;
|
||||
radius:float;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
flatc -c *.fbs $@
|
||||
Reference in New Issue
Block a user