Update all gradle dependencies we have (#1173)

This commit is contained in:
Uriel authored and GitHub committed 2024-10-10 14:58:13 +02:00
1 parent a2d842d8cc
commit 066760bf79
18 files changed
+113 -73

No files matched your search

@@ -35,7 +35,7 @@ class QuaternionMovingAverage(
// GUI should clamp it from 0.01 (1%) or 0.1 (10%)
// to 1 (100%).
amount = amount.coerceAtLeast(0f)
if (type === TrackerFilters.SMOOTHING) {
if (type == TrackerFilters.SMOOTHING) {
// lower smoothFactor = more smoothing
smoothFactor = SMOOTH_MULTIPLIER * (1 - amount.coerceAtMost(1f)) + SMOOTH_MIN
// Totally a hack
@@ -43,7 +43,7 @@ class QuaternionMovingAverage(
smoothFactor /= amount
}
}
if (type === TrackerFilters.PREDICTION) {
if (type == TrackerFilters.PREDICTION) {
// higher predictFactor = more prediction
predictFactor = PREDICT_MULTIPLIER * amount + PREDICT_MIN
rotBuffer = CircularArrayList(PREDICT_BUFFER)
@@ -95,7 +95,7 @@ class QuaternionMovingAverage(
@Synchronized
fun addQuaternion(q: Quaternion) {
if (type === TrackerFilters.PREDICTION) {
if (type == TrackerFilters.PREDICTION) {
if (rotBuffer.size == rotBuffer.capacity()) {
rotBuffer.removeLast()
}
@@ -102,7 +102,7 @@ class UnityArmature(localRot: Boolean) {
fun setLocalRotationForBone(unityBone: UnityBone, localRot: Quaternion) {
val node = getHeadNodeOfBone(unityBone)
if (node != null) {
if (unityBone === UnityBone.HIPS) {
if (unityBone == UnityBone.HIPS) {
node.worldTransform.rotation = localRot
} else {
node.localTransform.rotation = when (unityBone) {
@@ -117,7 +117,7 @@ class UnityArmature(localRot: Boolean) {
fun getGlobalTranslationForBone(unityBone: UnityBone): Vector3 {
val node = getHeadNodeOfBone(unityBone)
return if (node != null) {
if (unityBone === UnityBone.HIPS) {
if (unityBone == UnityBone.HIPS) {
val hipsAverage = (
leftHipNode.worldTransform.translation +
rightHipNode.worldTransform.translation
@@ -134,7 +134,7 @@ class UnityArmature(localRot: Boolean) {
fun getLocalTranslationForBone(unityBone: UnityBone): Vector3 {
val node = getHeadNodeOfBone(unityBone)
return if (node != null) {
if (unityBone === UnityBone.HIPS) {
if (unityBone == UnityBone.HIPS) {
val hipsAverage = (
leftHipNode.worldTransform.translation +
rightHipNode.worldTransform.translation
@@ -160,7 +160,7 @@ class UnityArmature(localRot: Boolean) {
fun getLocalRotationForBone(unityBone: UnityBone): Quaternion {
val node = getHeadNodeOfBone(unityBone)
return if (node != null) {
if (unityBone === UnityBone.HIPS) {
if (unityBone == UnityBone.HIPS) {
node.worldTransform.rotation * rootRotation
} else {
node.parent!!.worldTransform.rotation.inv() * node.worldTransform.rotation
@@ -169,7 +169,7 @@ class VMCHandler(
try {
val addr = InetAddress.getByName(ip)
oscSender = OSCPortOut(InetSocketAddress(addr, portOut))
if ((lastPortOut != portOut && lastAddress !== addr) || !wasConnected) {
if ((lastPortOut != portOut && lastAddress != addr) || !wasConnected) {
LogManager
.info(
"[VMCHandler] Sending to port $portOut at address $ip",
@@ -80,7 +80,7 @@ class VRCOSCHandler(
override fun refreshSettings(refreshRouterSettings: Boolean) {
// Sets which trackers are enabled and force head and hands to false
for (i in computedTrackers.indices) {
if (computedTrackers[i].trackerPosition !== TrackerPosition.HEAD || computedTrackers[i].trackerPosition !== TrackerPosition.LEFT_HAND || computedTrackers[i].trackerPosition !== TrackerPosition.RIGHT_HAND) {
if (computedTrackers[i].trackerPosition != TrackerPosition.HEAD || computedTrackers[i].trackerPosition != TrackerPosition.LEFT_HAND || computedTrackers[i].trackerPosition != TrackerPosition.RIGHT_HAND) {
trackersEnabled[i] = config
.getOSCTrackerRole(
computedTrackers[i].trackerPosition!!.trackerRole!!,
@@ -199,7 +199,7 @@ class VRCOSCHandler(
try {
val addr = InetAddress.getByName(ip)
oscSender = OSCPortOut(InetSocketAddress(addr, portOut))
if (oscPortOut != portOut && oscIp !== addr || !wasConnected) {
if (oscPortOut != portOut && oscIp != addr || !wasConnected) {
LogManager.info("[VRCOSCHandler] Sending to port $portOut at address $ip")
}
oscPortOut = portOut
@@ -463,7 +463,7 @@ class VRCOSCHandler(
),
)
}
if (computedTrackers[i].trackerPosition === TrackerPosition.HEAD) {
if (computedTrackers[i].trackerPosition == TrackerPosition.HEAD) {
// Send HMD position
val (x, y, z) = computedTrackers[i].position
oscArgs.clear()
@@ -111,7 +111,7 @@ class SkeletonConfigManager(
fun setToggle(config: SkeletonConfigToggles, newValue: Boolean?) {
if (newValue != null) {
if (configToggles[config] != null && (newValue !== configToggles[config])) {
if (configToggles[config] != null && (newValue != configToggles[config])) {
changedToggles[config.id - 1] = true
}
configToggles[config] = newValue
@@ -210,7 +210,7 @@ class Localizer(humanSkeleton: HumanSkeleton) {
// update the target position of the foot
private fun updateTargetPos(loc: Vector3, foot: MovementStates) {
if (foot == plantedFoot) {
if (worldReference === MovementStates.FOLLOW_COM) {
if (worldReference == MovementStates.FOLLOW_COM) {
targetFoot = loc
}
} else {
@@ -255,16 +255,16 @@ class Localizer(humanSkeleton: HumanSkeleton) {
// update how long the COM has been the reference and how long the foot
// has been
comFrames = if (worldReference === MovementStates.FOLLOW_COM) comFrames + 1 else 0
footFrames = if (worldReference === MovementStates.FOLLOW_FOOT) footFrames + 1 else 0
sittingFrames = if (worldReference === MovementStates.FOLLOW_SITTING) sittingFrames + 1 else 0
comFrames = if (worldReference == MovementStates.FOLLOW_COM) comFrames + 1 else 0
footFrames = if (worldReference == MovementStates.FOLLOW_FOOT) footFrames + 1 else 0
sittingFrames = if (worldReference == MovementStates.FOLLOW_SITTING) sittingFrames + 1 else 0
}
// gets the position the COM should be at based on the velocity of the com and
// the location of the floor
private fun updateTargetCOM() {
// if not in COM tracking mode, just use the current COM
if (worldReference === MovementStates.FOLLOW_FOOT || worldReference === MovementStates.FOLLOW_SITTING) {
if (worldReference == MovementStates.FOLLOW_FOOT || worldReference == MovementStates.FOLLOW_SITTING) {
targetCOM = bufCur.centerOfMass
} else {
currentCOM = targetCOM
@@ -293,7 +293,7 @@ class Localizer(humanSkeleton: HumanSkeleton) {
val comPosStart: Vector3 = buf.centerOfMass
// get the buffer that occurred VELOCITY_SAMPLE_RATE ago in time
while (buf.timeOfFrame > timeEnd && buf.parent !== null) {
while (buf.timeOfFrame > timeEnd && buf.parent != null) {
buf = buf.parent!!
}
@@ -73,7 +73,7 @@ class TapDetection {
accelList.add(listval)
// remove old values from the list (if they are too old)
while (time - accelList.first[1] > CLUMP_TIME_NS) {
while (time - accelList.first()[1] > CLUMP_TIME_NS) {
accelList.removeFirst()
}
@@ -93,7 +93,7 @@ class TapDetection {
// remove old taps from the list (if they are too old)
if (!tapTimes.isEmpty()) {
while (time - tapTimes.first > timeWindowNS) {
while (time - tapTimes.first() > timeWindowNS) {
tapTimes.removeFirst()
if (tapTimes.isEmpty()) return
}
@@ -31,7 +31,7 @@ object TrackerUtils {
position: TrackerPosition,
): Tracker? {
val resetTrackers = allTrackers.filter {
it.trackerPosition === position &&
it.trackerPosition == position &&
!it.isInternal &&
!it.status.reset
}
@@ -51,7 +51,7 @@ object TrackerUtils {
position: TrackerPosition,
): Tracker? {
val resetTrackers = allTrackers.filter {
it.trackerPosition === position &&
it.trackerPosition == position &&
!it.isComputed &&
!it.isInternal &&
!it.status.reset
@@ -72,7 +72,7 @@ object TrackerUtils {
position: TrackerPosition,
): Tracker? {
val resetTrackers = allTrackers.filter {
it.trackerPosition === position &&
it.trackerPosition == position &&
!it.isImu() &&
!it.isInternal &&
!it.status.reset
@@ -221,15 +221,15 @@ value class Matrix3
* finds the rotation matrix closest to all given rotation matrices.
* multiply input matrices by a weight for weighted averaging.
* WARNING: NOT ANGULAR
* @param others a variable number of additional matrices to average
* @param others a variable number of additional boxed matrices to average
* @return the average rotation matrix
*/
fun average(vararg others: Matrix3): Matrix3 {
fun average(vararg others: ObjectMatrix3): Matrix3 {
var count = 1f
var sum = this
others.forEach {
count += 1f
sum += it
sum += it.toValue()
}
return (sum / count).orthonormalize()
}
@@ -460,6 +460,16 @@ value class Matrix3
*/
fun toEulerAngles(order: EulerOrder): EulerAngles =
orthonormalize().toEulerAnglesAssumingOrthonormal(order)
fun toObject() = ObjectMatrix3(xx, yx, zx, xy, yy, zy, xz, yz, zz)
}
data class ObjectMatrix3(
val xx: Float, val yx: Float, val zx: Float,
val xy: Float, val yy: Float, val zy: Float,
val xz: Float, val yz: Float, val zz: Float
) {
fun toValue() = Matrix3(xx, yx, zx, xy, yy, zy, xz, yz, zz)
}
operator fun Float.times(that: Matrix3): Matrix3 = that * this