mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-06 08:42:32 -08:00
time syntax
This commit is contained in:
1 parent
3e90e81a6a
commit
46b48055d0
5 files changed
+9
-5
No files matched your search
@@ -4,6 +4,7 @@ import com.jme3.math.FastMath
|
||||
import dev.slimevr.config.TextFileHandle
|
||||
import dev.slimevr.skeleton.BODY_PART_HIERARCHY_MAP
|
||||
import dev.slimevr.skeleton.ComputedSkeleton
|
||||
import dev.slimevr.util.millisecondsInSecond
|
||||
import io.github.axisangles.ktmath.EulerOrder
|
||||
import io.github.axisangles.ktmath.Quaternion
|
||||
import io.github.axisangles.ktmath.Vector3
|
||||
@@ -51,7 +52,7 @@ class BvhStream(
|
||||
|
||||
val now = System.currentTimeMillis()
|
||||
if (frameCount > 0) {
|
||||
val interval = (now - lastFrameTime) / 1000f
|
||||
val interval = (now - lastFrameTime) / millisecondsInSecond
|
||||
frameIntervals.add(interval)
|
||||
}
|
||||
lastFrameTime = now
|
||||
|
||||
@@ -96,7 +96,7 @@ class ResetsManager(
|
||||
|
||||
// Wait for the reset delay while updating the GUI every second
|
||||
repeat(fullSeconds) { index ->
|
||||
delay(1000)
|
||||
delay(1.seconds)
|
||||
// Skip final tick if at the same time as finish
|
||||
if (index != fullSeconds - 1 || remainder != 0) {
|
||||
server.sendSolarxrRpc(
|
||||
|
||||
@@ -9,13 +9,14 @@ import dev.slimevr.util.timeSource
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.isActive
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
class TrackerTpsBehaviour : TrackerBehaviour {
|
||||
override fun observe(receiver: Tracker) {
|
||||
receiver.context.scope.launch {
|
||||
var mark = timeSource.markNow()
|
||||
while (isActive) {
|
||||
delay(1000)
|
||||
delay(1.seconds)
|
||||
val elapsed = mark.elapsedNow()
|
||||
val trackerState = receiver.context.state.value
|
||||
val tps = (trackerState.accumulatedTicks * 1000u).toLong() / elapsed.inWholeMilliseconds
|
||||
|
||||
@@ -87,7 +87,7 @@ class PingBehaviour : UDPConnectionBehaviour {
|
||||
receiver.context.dispatch(UDPConnectionActions.StartPing(startTime = System.currentTimeMillis(), pingId = pingId))
|
||||
receiver.send(PingPong(pingId))
|
||||
}
|
||||
delay(1000)
|
||||
delay(1.seconds)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ import dev.slimevr.osc.OscContent
|
||||
import dev.slimevr.osc.OscMessage
|
||||
import dev.slimevr.skeleton.BoneState
|
||||
import dev.slimevr.skeleton.ComputedSkeleton
|
||||
import dev.slimevr.util.inFloatingSeconds
|
||||
import dev.slimevr.util.millisecondsInSecond
|
||||
import io.github.axisangles.ktmath.Quaternion
|
||||
import io.github.axisangles.ktmath.Vector3
|
||||
import solarxr_protocol.datatypes.BodyPart
|
||||
@@ -22,7 +24,7 @@ internal fun buildOutgoingBundle(
|
||||
elapsed: Duration,
|
||||
): OscBundle {
|
||||
val contents = buildList {
|
||||
add(OscContent.Message(OscMessage("/VMC/Ext/T", listOf(OscArg.Float(elapsed.inWholeMilliseconds / 1000f)))))
|
||||
add(OscContent.Message(OscMessage("/VMC/Ext/T", listOf(OscArg.Float(elapsed.inFloatingSeconds)))))
|
||||
add(OscContent.Message(OscMessage("/VMC/Ext/OK", listOf(OscArg.Int(1)))))
|
||||
|
||||
// Send the origin (0, 0, 0) as root
|
||||
|
||||
Reference in new issue
Block a user