From 14167fadad4fb0438d33dd3a504177de72a6b1e0 Mon Sep 17 00:00:00 2001 From: Nova Date: Wed, 9 Feb 2022 17:31:52 -0500 Subject: [PATCH] Updated docs more --- docs/stardust-protocol/server/objects/field.md | 2 ++ docs/stardust-protocol/server/objects/input.md | 3 +++ docs/stardust-protocol/server/objects/root.md | 2 +- .../server/objects/spatial.md | 9 ++++++--- docs/stardust-protocol/server/types/Model.md | 2 +- docs/stardust-protocol/server/types/Node.md | 5 ++++- docs/stardust-protocol/server/types/Spatial.md | 13 +++++++++++-- docs/stardust-protocol/server/types/Zone.md | 18 ++++++++++++++++++ .../server/types/field/CylinderField.md | 7 +++++++ .../server/types/input/InputHandler.md | 11 +---------- .../server/types/item/_category_.json | 4 ++++ 11 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 docs/stardust-protocol/server/types/Zone.md create mode 100644 docs/stardust-protocol/server/types/field/CylinderField.md create mode 100644 docs/stardust-protocol/server/types/item/_category_.json diff --git a/docs/stardust-protocol/server/objects/field.md b/docs/stardust-protocol/server/objects/field.md index b3d25d7f..19e8fade 100644 --- a/docs/stardust-protocol/server/objects/field.md +++ b/docs/stardust-protocol/server/objects/field.md @@ -6,6 +6,8 @@ Object managing fields for interaction. ### `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`. \ 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 a1ec8e98..e4aa5a61 100755 --- a/docs/stardust-protocol/server/objects/input.md +++ b/docs/stardust-protocol/server/objects/input.md @@ -9,5 +9,8 @@ Object managing input and interaction. ### `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> 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. \ No newline at end of file diff --git a/docs/stardust-protocol/server/objects/root.md b/docs/stardust-protocol/server/objects/root.md index 2b098e22..9be8d1c2 100644 --- a/docs/stardust-protocol/server/objects/root.md +++ b/docs/stardust-protocol/server/objects/root.md @@ -11,4 +11,4 @@ Executes `method` on object at `path` on the client when the main logic loop of `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. \ No newline at end of file +Lets the server know that the client wishes to disconnect. After this it can be assumed the client is disconnected from the server. diff --git a/docs/stardust-protocol/server/objects/spatial.md b/docs/stardust-protocol/server/objects/spatial.md index 5d23f9ff..3aed219c 100644 --- a/docs/stardust-protocol/server/objects/spatial.md +++ b/docs/stardust-protocol/server/objects/spatial.md @@ -1,7 +1,10 @@ # /spatial -Object managing spatial nodes for parenting. +Object managing spatial objects and spatial manipulation. ## Signals -### `create(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/[name]` with parent at `spacePath`. \ No newline at end of file +### `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`). \ 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 2e3d3192..f8896dc4 100644 --- a/docs/stardust-protocol/server/types/Model.md +++ b/docs/stardust-protocol/server/types/Model.md @@ -4,7 +4,7 @@ sidebar_position: 3 # Model ### Derived from [Spatial](Spatial) -A graphical model. +A graphical model. It will only show when enabled. ## Properties diff --git a/docs/stardust-protocol/server/types/Node.md b/docs/stardust-protocol/server/types/Node.md index 1f16f751..2399ba00 100644 --- a/docs/stardust-protocol/server/types/Node.md +++ b/docs/stardust-protocol/server/types/Node.md @@ -7,4 +7,7 @@ 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. \ No newline at end of file +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. \ 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 2f437d49..208c51f4 100644 --- a/docs/stardust-protocol/server/types/Spatial.md +++ b/docs/stardust-protocol/server/types/Spatial.md @@ -14,8 +14,10 @@ If false, object's origin cannot be modified from a client. 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. -## Methods +## Signals ### `move(Vector3 position)` Moves the Spatial relative to itself if `translatable` is not `false`. @@ -44,4 +46,11 @@ Sets the transform relative to the Spatial's space if `translatable`, `rotatable 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. \ No newline at end of file +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 getTransform(null)` +Returns the `origin`, `orientation`, and `scale` of this spatial relative to its parent. \ No newline at end of file diff --git a/docs/stardust-protocol/server/types/Zone.md b/docs/stardust-protocol/server/types/Zone.md new file mode 100644 index 00000000..620bf0cc --- /dev/null +++ b/docs/stardust-protocol/server/types/Zone.md @@ -0,0 +1,18 @@ +--- +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. \ No newline at end of file diff --git a/docs/stardust-protocol/server/types/field/CylinderField.md b/docs/stardust-protocol/server/types/field/CylinderField.md new file mode 100644 index 00000000..2415d568 --- /dev/null +++ b/docs/stardust-protocol/server/types/field/CylinderField.md @@ -0,0 +1,7 @@ +# 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. \ No newline at end of file diff --git a/docs/stardust-protocol/server/types/input/InputHandler.md b/docs/stardust-protocol/server/types/input/InputHandler.md index 1ec906df..cbbcbf9a 100755 --- a/docs/stardust-protocol/server/types/input/InputHandler.md +++ b/docs/stardust-protocol/server/types/input/InputHandler.md @@ -4,18 +4,9 @@ sidebar_position: 1 # InputHandler ## Derived from [Spatial](../Spatial) (`scalable: false`) -A handler to allow clients to recieve input. +A handler to allow clients to recieve input. Won't send input through the callback if disabled. ## Methods -### `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` relative to the pose's space. - ### `setField(string field)` Sets the field this input handler will use. diff --git a/docs/stardust-protocol/server/types/item/_category_.json b/docs/stardust-protocol/server/types/item/_category_.json new file mode 100644 index 00000000..3ab678ad --- /dev/null +++ b/docs/stardust-protocol/server/types/item/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Item", + "position": 6 +}