Updated documentation
This commit is contained in:
@@ -16,9 +16,16 @@ public void stopListening() { ... }
|
|||||||
|
|
||||||
Parses an incoming WebSocket message packet and processes the data.
|
Parses an incoming WebSocket message packet and processes the data.
|
||||||
The data that is accepted is a string that can be of the following formats:
|
The data that is accepted is a string that can be of the following formats:
|
||||||
- "data `Ax`;`Ay`;`Az`;`Rx`;`Ry`;`Rz`"
|
```java
|
||||||
- "sampleRate `x`"
|
// Sending data
|
||||||
- "calibrate `x`;`y`;`z`"
|
"data accelerationX;accelerationY;accelerationZ;rotationX;rotationY;rotationZ" // all values are floats
|
||||||
|
|
||||||
|
// Changing the sample rate
|
||||||
|
"sampleRate rate" // rate is an integer
|
||||||
|
|
||||||
|
// Calibrating the zero point
|
||||||
|
"zero x;y;z" // x, y, z are floats
|
||||||
|
```
|
||||||
```java
|
```java
|
||||||
public void parsePacket(@NotNull String message) { ... }
|
public void parsePacket(@NotNull String message) { ... }
|
||||||
```
|
```
|
||||||
@@ -29,6 +36,11 @@ motionDataEventHandler with the calculated vector.
|
|||||||
public void addMotionData(MotionData data) { ... }
|
public void addMotionData(MotionData data) { ... }
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Sets the gesture path to the provided path.
|
||||||
|
```java
|
||||||
|
public void setGesturePath(GesturePath gesturePath) { ... }
|
||||||
|
```
|
||||||
|
|
||||||
Updates the relative path to the provided path.
|
Updates the relative path to the provided path.
|
||||||
```java
|
```java
|
||||||
public void setRelativePath(List<Vector3> relativePath) { ... }
|
public void setRelativePath(List<Vector3> relativePath) { ... }
|
||||||
@@ -51,15 +63,24 @@ This compares the relative path (calibrated) to the provided path segments,
|
|||||||
and returns the offsets.
|
and returns the offsets.
|
||||||
```java
|
```java
|
||||||
public List<Double> getErrors(GesturePath referencePath) { ... }
|
public List<Double> getErrors(GesturePath referencePath) { ... }
|
||||||
|
public List<Double> getErrors() { ... } // Using pre-set path
|
||||||
```
|
```
|
||||||
|
|
||||||
Get the error offset of the provided vector to the provided path.
|
Get the error offset of the provided vector to the provided path, or with the
|
||||||
|
set path.
|
||||||
This compares a given vector to the provided GesturePath object.
|
This compares a given vector to the provided GesturePath object.
|
||||||
```java
|
```java
|
||||||
public double getError(GesturePath path, Vector3 referencePoint) { ... }
|
public double getError(GesturePath path, Vector3 referencePoint) { ... }
|
||||||
|
public double getError(Vector3 referencePoint) { ... } // Using pre-set path
|
||||||
```
|
```
|
||||||
|
|
||||||
Get the average error offset of the relative path and the provided GesturePath object.
|
Get the average error offset of the relative path and the provided GesturePath object.
|
||||||
```java
|
```java
|
||||||
public double getAverageError(GesturePath referencePath) { ... }
|
public double getAverageError(GesturePath referencePath) { ... }
|
||||||
```
|
public double getAverageError() { ... } // Using pre-set path
|
||||||
|
```
|
||||||
|
|
||||||
|
Logs statistics to the console
|
||||||
|
```java
|
||||||
|
public void logStatistics(GesturePath referencePath) { ... }
|
||||||
|
```
|
||||||
|
Reference in New Issue
Block a user