Skip to content

Commit 76d087e

Browse files
committed
Review: rename updateTrackersVelocityPolicy and rephrase updateDerivedVelocity KDoc
1 parent ec178b6 commit 76d087e

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

server/core/src/main/java/dev/slimevr/config/VelocityConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class VelocityConfig {
1111
// Disables derived velocity for all trackers. Driver zeroes out velocity if nothing is returned in protobuf message.
1212
var sendDerivedVelocity: Boolean = false
1313

14-
fun updateTrackersVelocityPolicy() {
14+
fun updateTrackersVelocitySettings() {
1515
for (t in VRServer.instance.allTrackers) {
1616
t.allowVelocity = sendDerivedVelocity
1717
}

server/core/src/main/java/dev/slimevr/protocol/rpc/settings/RPCSettingsHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ class RPCSettingsHandler(var rpcHandler: RPCHandler, var api: ProtocolAPI) {
365365
if (req.velocitySettings() != null) {
366366
val velocityConfig = api.server.configManager.vrConfig.velocityConfig
367367
velocityConfig.sendDerivedVelocity = req.velocitySettings().sendDerivedVelocity()
368-
velocityConfig.updateTrackersVelocityPolicy()
368+
velocityConfig.updateTrackersVelocitySettings()
369369
}
370370

371371
api.server.configManager.saveConfig()

server/core/src/main/java/dev/slimevr/tracking/trackers/Tracker.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,9 @@ class Tracker @JvmOverloads constructor(
367367
}
368368

369369
/**
370-
* Updates the derived velocity of the tracker by differentiating position over time.
371-
*
372-
* This method enforces the [allowVelocity] policy and checks for valid position data before
373-
* proceeding. If conditions are met, it calculates velocity based on the displacement since the
374-
* last update, applying a sanity check on the time delta to filter out noise and ensure data stability.
375-
*
370+
* If derived velocity is enabled, updates the derived velocity of the tracker,
371+
* calculating it based on the position displacement since the last update,
372+
* applying a sanity check on the time delta to filter out noise and ensure data stability.
376373
*/
377374
fun updateDerivedVelocity() {
378375
if (!allowVelocity || !hasPosition) {

0 commit comments

Comments
 (0)