From 207dd5489d9ace9fe24f8cab298199bf3747d5c8 Mon Sep 17 00:00:00 2001 From: hammy3502 Date: Sat, 16 Sep 2023 18:57:50 -0400 Subject: [PATCH] Several Fixes from Testing --- .../vivecraft/api/client/VivecraftClientAPI.java | 14 +++++++++----- .../vivecraft/api/client/data/VRPoseHistory.java | 3 ++- .../main/java/org/vivecraft/api/data/VRData.java | 3 ++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/org/vivecraft/api/client/VivecraftClientAPI.java b/common/src/main/java/org/vivecraft/api/client/VivecraftClientAPI.java index 5aa5ba71a..d8b6aaa29 100644 --- a/common/src/main/java/org/vivecraft/api/client/VivecraftClientAPI.java +++ b/common/src/main/java/org/vivecraft/api/client/VivecraftClientAPI.java @@ -71,7 +71,9 @@ static VivecraftClientAPI getInstance() { * * @param controllerNum The controller number to trigger a haptic pulse. 0 is the primary controller, while 1 is * the secondary controller. - * @param duration The duration of the haptic pulse in seconds. + * @param duration The duration of the haptic pulse in seconds. Note that this number is passed to the + * underlying VR API used by Vivecraft, and may act with a shorter length than expected beyond + * very short pulses. * @param frequency The frequency of the haptic pulse in Hz. 160 is a safe bet for this number, with Vivecraft's codebase * using anywhere from 160F for actions such as a bite on a fishing line, to 1000F for things such * as a chat notification. @@ -87,7 +89,9 @@ static VivecraftClientAPI getInstance() { * * @param controllerNum The controller number to trigger a haptic pulse. 0 is the primary controller, while 1 is * the secondary controller. - * @param duration The duration of the haptic pulse in seconds. + * @param duration The duration of the haptic pulse in seconds. Note that this number is passed to the + * underlying VR API used by Vivecraft, and may act with a shorter length than expected beyond + * very short pulses. */ default void triggerHapticPulse(int controllerNum, float duration) { triggerHapticPulse(controllerNum, duration, 160F, 1F, 0F); @@ -147,7 +151,7 @@ default void triggerHapticPulse(int controllerNum, float duration) { * @return The historical VR data for the player's controller, or null if the player isn't in VR. */ @Nullable - default VRPoseHistory getHistoricalVRControllerData(InteractionHand hand) { + default VRPoseHistory getHistoricalVRControllerPoses(InteractionHand hand) { return getHistoricalVRControllerPoses(hand.ordinal()); } @@ -157,7 +161,7 @@ default VRPoseHistory getHistoricalVRControllerData(InteractionHand hand) { * @return The historical VR data for the player's primary controller, or null if the player isn't in VR. */ @Nullable - default VRPoseHistory getHistoricalVRController0Data() { + default VRPoseHistory getHistoricalVRController0Poses() { return getHistoricalVRControllerPoses(0); } @@ -167,7 +171,7 @@ default VRPoseHistory getHistoricalVRController0Data() { * @return The historical VR data for the player's secondary controller, or null if the player isn't in VR. */ @Nullable - default VRPoseHistory getHistoricalVRController1Data() { + default VRPoseHistory getHistoricalVRController1Poses() { return getHistoricalVRControllerPoses(1); } } diff --git a/common/src/main/java/org/vivecraft/api/client/data/VRPoseHistory.java b/common/src/main/java/org/vivecraft/api/client/data/VRPoseHistory.java index 6afebc421..c2d08cecf 100644 --- a/common/src/main/java/org/vivecraft/api/client/data/VRPoseHistory.java +++ b/common/src/main/java/org/vivecraft/api/client/data/VRPoseHistory.java @@ -21,7 +21,8 @@ public interface VRPoseHistory { int MAX_TICKS_BACK = 20; /** - * @return The amount of ticks worth of history being held. + * @return The amount of ticks worth of history being held. The number returned by this methodwill never be higher + * than {@link VRPoseHistory#MAX_TICKS_BACK}, however can be lower than it. */ int ticksOfHistory(); diff --git a/common/src/main/java/org/vivecraft/api/data/VRData.java b/common/src/main/java/org/vivecraft/api/data/VRData.java index fe1a3d256..124eabb8e 100644 --- a/common/src/main/java/org/vivecraft/api/data/VRData.java +++ b/common/src/main/java/org/vivecraft/api/data/VRData.java @@ -5,7 +5,8 @@ /** * Represents all VR data associated with a given player, mainly the pose of the HMD and both controllers - * of the player. + * of the player. If the player is in seated mode, controller 1 carries the HMD's data, and controller 0 is + * based on the direction being looked at via the mouse pointer. */ public interface VRData {