diff --git a/docs/stardust-protocol/protocol.md b/docs/stardust-protocol/protocol.md index d4bbf0c5..7a12db78 100644 --- a/docs/stardust-protocol/protocol.md +++ b/docs/stardust-protocol/protocol.md @@ -3,8 +3,9 @@ sidebar_position: 1 --- # Protocol + ## Data -Every message uses flatbuffers and most use flexbuffers to add variant data such as method arguments and return values. The flatbuffers Message type is: +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; @@ -23,7 +24,9 @@ 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` | @@ -35,6 +38,7 @@ All fields not accounted for are assumed to be not included or `0` or `""` ### Signal Signals are method calls that do not expect a response of any kind. + | Field Name | Value | |-:|:-| | `type` | `1` | @@ -43,7 +47,8 @@ Signals are method calls that do not expect a response of any kind. | `data` | Flexbuffer containing arguments to pass to remote method | ### Method Call -Method calls allow for remote procedure calling and should block the thread they are sent from until a response is heard. +Method calls allow for remote procedure calling. + | Field Name | Value | |-:|:-| | `type` | `2` | @@ -54,6 +59,7 @@ Method calls allow for remote procedure calling and should block the thread they ### Method Return Message to pass the return value back to the program. + | Field Name | Value | |-:|:-| | `type` | `3` | diff --git a/docs/stardust-protocol/server/objects/field.md b/docs/stardust-protocol/server/objects/field.md index 254fb5f9..dc617496 100644 --- a/docs/stardust-protocol/server/objects/field.md +++ b/docs/stardust-protocol/server/objects/field.md @@ -4,8 +4,8 @@ Object managing fields for interaction. ## Signals ### `createBoxField(string name, Vector3 origin, Quaternion orientation, Vector3 size)` -Creates a new [[BoxField]] at `/field/[name]`. +Creates a new [BoxField](../types/field/BoxField.md) at `/field/[name]`. ### `createSphereField(string name, Vector3 origin, float radius)` -Creates a new [[SphereField]] at `/field/[name]`. \ No newline at end of file +Creates a new [SphereField](../types/field/SphereField.md) at `/field/[name]`. \ No newline at end of file diff --git a/docs/stardust-protocol/server/objects/input.md b/docs/stardust-protocol/server/objects/input.md index 93669769..04d6a873 100755 --- a/docs/stardust-protocol/server/objects/input.md +++ b/docs/stardust-protocol/server/objects/input.md @@ -3,8 +3,8 @@ Object managing input and interaction. ## Signals -### `registerPointerInput(string name, Vector3 origin, Vector3 direction, float tilt)` -Creates a new [[Pointerinput]] 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]] with the specified `name` and `field`, located relative to the space referenced in `spacePath` and the `postion` + `rotation`. \ No newline at end of file +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`. \ No newline at end of file diff --git a/docs/stardust-protocol/server/objects/model.md b/docs/stardust-protocol/server/objects/model.md index 8fac9097..e6c2ef00 100644 --- a/docs/stardust-protocol/server/objects/model.md +++ b/docs/stardust-protocol/server/objects/model.md @@ -4,4 +4,4 @@ Object managing graphical models. ## Signals ### `createFromFile(string name, string path)` -Creates a new [[Model]] at `/model/[name]`. \ No newline at end of file +Creates a new [Model](../types/Model.md) at `/model/[name]`. \ No newline at end of file diff --git a/docs/stardust-protocol/server/objects/spatial.md b/docs/stardust-protocol/server/objects/spatial.md index f8ce3283..61ae922f 100644 --- a/docs/stardust-protocol/server/objects/spatial.md +++ b/docs/stardust-protocol/server/objects/spatial.md @@ -4,4 +4,4 @@ Object managing spatial nodes for parenting. ## Signals ### `create(string name, Vector3 origin, Quat orientation, Vector3 scale, bool translatable, bool rotatable, bool scalable)` -Creates a new [[Spatial]] at `/spatial/[name]`. \ No newline at end of file +Creates a new [Spatial](../types/Spatial.md) at `/spatial/[name]`. \ No newline at end of file diff --git a/docs/stardust-protocol/server/types/Model.md b/docs/stardust-protocol/server/types/Model.md index 68ce785d..7bd9ab4f 100644 --- a/docs/stardust-protocol/server/types/Model.md +++ b/docs/stardust-protocol/server/types/Model.md @@ -3,7 +3,7 @@ sidebar_position: 3 --- # Model -### Derived from [[Spatial]] +### Derived from [Spatial](Spatial) A graphical model. ## Properties diff --git a/docs/stardust-protocol/server/types/Node.md b/docs/stardust-protocol/server/types/Node.md index 3dc92abb..ff849065 100644 --- a/docs/stardust-protocol/server/types/Node.md +++ b/docs/stardust-protocol/server/types/Node.md @@ -3,8 +3,8 @@ sidebar_position: 1 --- # Node -A base type for all othertypes that exist in 3D space. +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. \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/stardust-protocol/server/types/Spatial.md b/docs/stardust-protocol/server/types/Spatial.md index 126e6ca0..0ec32de8 100644 --- a/docs/stardust-protocol/server/types/Spatial.md +++ b/docs/stardust-protocol/server/types/Spatial.md @@ -3,17 +3,17 @@ sidebar_position: 2 --- # Spatial -### Derived from [[Node]] +### 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 [[Field]]s 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]]". +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. [[Field]]s, [[PointerInput]]s). +If false, object's scale cannot be modified from a client (e.g. [Fields](field/Field), [PointerInput](input/inputtypes/PointerInput.md)). ## Methods ### `move(Vector3 position)` diff --git a/docs/stardust-protocol/server/types/field/BoxField.md b/docs/stardust-protocol/server/types/field/BoxField.md index e2090ef4..1fef049d 100644 --- a/docs/stardust-protocol/server/types/field/BoxField.md +++ b/docs/stardust-protocol/server/types/field/BoxField.md @@ -1,5 +1,6 @@ # BoxField -Derived from [[Field]], this Field is in a rectangular prism shape. +### Derived from [Field](Field) +This field is in a rectangular prism shape. ## Properties ### `setSize(Vector3 size)` diff --git a/docs/stardust-protocol/server/types/field/Field.md b/docs/stardust-protocol/server/types/field/Field.md index b84d6de8..e1c0514e 100644 --- a/docs/stardust-protocol/server/types/field/Field.md +++ b/docs/stardust-protocol/server/types/field/Field.md @@ -1,6 +1,6 @@ # Field -### Derived from [[Spatial]] -Type that contains methods all Fields share. All fields created are under `/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)` diff --git a/docs/stardust-protocol/server/types/field/SphereField.md b/docs/stardust-protocol/server/types/field/SphereField.md index a7e0ef0c..6ff4447b 100644 --- a/docs/stardust-protocol/server/types/field/SphereField.md +++ b/docs/stardust-protocol/server/types/field/SphereField.md @@ -1,5 +1,6 @@ # SphereField -Derived from [[Field]], this Field is in a sphere shape. +### Derived from [Field](Field) +This Field is in a sphere shape. ## Properties ### `setRadius(double size)` diff --git a/docs/stardust-protocol/server/types/input/InputHandler.md b/docs/stardust-protocol/server/types/input/InputHandler.md index 7980f704..16c7c664 100755 --- a/docs/stardust-protocol/server/types/input/InputHandler.md +++ b/docs/stardust-protocol/server/types/input/InputHandler.md @@ -2,7 +2,7 @@ sidebar_position: 1 --- # InputHandler -## Derived from [[Spatial]] (`scalable: false`) +## Derived from [Spatial](../Spatial) (`scalable: false`) A handler to allow clients to recieve input. diff --git a/docs/stardust-protocol/server/types/input/InputMethod.md b/docs/stardust-protocol/server/types/input/InputMethod.md index 92255c21..e2d7e548 100755 --- a/docs/stardust-protocol/server/types/input/InputMethod.md +++ b/docs/stardust-protocol/server/types/input/InputMethod.md @@ -2,6 +2,7 @@ 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 @@ -10,11 +11,11 @@ Represents an input device generically, with specifics being fleshed out in subc |---|--------------|-------------------------------------------------------------------------------------------------------------| | 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]] | Defined by origin, direction, and tilt with datamap for buttons, trackpad, etc. | -| 3 | [[HandInput]] | Contains a full 27-bone hand skeleton (including forearm) and datamap for abstractions like grip, pinch distance/point, 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: +See [Datamap:](#datamap) ## Internal Methods ### `distanceToField(string field)` @@ -42,8 +43,8 @@ The datamap is a dictionary containing abstracted and raw data related to the in 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]]. This pose also defines the main interaction point. + + ### `modifyDatamap(Dictionary data)` -Modifies the datamap of this [[InputMethod]]. 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. \ No newline at end of file +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. \ No newline at end of file diff --git a/docs/stardust-protocol/server/types/input/inputtypes/HandInput.md b/docs/stardust-protocol/server/types/input/inputtypes/HandInput.md index a4e9505a..a02afce9 100644 --- a/docs/stardust-protocol/server/types/input/inputtypes/HandInput.md +++ b/docs/stardust-protocol/server/types/input/inputtypes/HandInput.md @@ -1,5 +1,5 @@ # HandInput -### Derived from [[InputMethod]] and [[Spatial]] (`scalable: false`) +### Derived from [InputMethod](../InputMethod) A full 27-bone hand+forearm input with useful abstractions provided through the datamap. diff --git a/docs/stardust-protocol/server/types/input/inputtypes/PointerInput.md b/docs/stardust-protocol/server/types/input/inputtypes/PointerInput.md index 23f6fe10..21cac0ed 100755 --- a/docs/stardust-protocol/server/types/input/inputtypes/PointerInput.md +++ b/docs/stardust-protocol/server/types/input/inputtypes/PointerInput.md @@ -1,7 +1,7 @@ # PointerInput -### Derived from [[InputMethod]] +### Derived from [InputMethod](../InputMethod) -An input method for pointers, such as the Huawei VR Glass's remote, a pointer put on an Index controller, Oculus style laser mouse, etc. +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. diff --git a/docs/stardust-protocol/server/types/input/inputtypes/_category_.json b/docs/stardust-protocol/server/types/input/inputtypes/_category_.json new file mode 100644 index 00000000..18c3b2a9 --- /dev/null +++ b/docs/stardust-protocol/server/types/input/inputtypes/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Input Method Types", + "position": 3 +}