Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSCQuery support #958

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open

OSCQuery support #958

wants to merge 41 commits into from

Conversation

Erimelowo
Copy link
Member

@Erimelowo Erimelowo commented Mar 13, 2024

OSCQuery allows VRChat's ports and address to be automatically detected.
It also allows SlimeVR to advertise that it wants head and controller data and for VRChat to send it to us.

@ImUrX
Copy link
Member

ImUrX commented Mar 13, 2024

I'm in pain

@Erimelowo Erimelowo marked this pull request as ready for review March 16, 2024 18:16
@Erimelowo Erimelowo marked this pull request as draft March 16, 2024 18:36
@Erimelowo Erimelowo marked this pull request as ready for review April 29, 2024 01:14
@@ -100,6 +102,8 @@ class VRServer @JvmOverloads constructor(

init {
// UwU
instance = this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what was the reason this was moved to the start instead of waiting for everything to initialize and then let instance be?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was for referencing vrserver as latestart or something.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update osc to 0.9 please 🥺

Comment on lines +122 to +125
"[VMCHandler] Error listening to the port " +
portIn +
": " +
e,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why, why return to monke

Suggested change
"[VMCHandler] Error listening to the port " +
portIn +
": " +
e,
"[VMCHandler] Error listening to the port $portIn: $e",

Comment on lines +162 to +165
"[VMCHandler] Sending to port " +
portOut +
" at address " +
address,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

Suggested change
"[VMCHandler] Sending to port " +
portOut +
" at address " +
address,
"[VMCHandler] Sending to port $portOut at address $address",

Comment on lines +176 to +181
"[VMCHandler] Error connecting to port " +
portOut +
" at the address " +
address +
": " +
e,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔪

Suggested change
"[VMCHandler] Error connecting to port " +
portOut +
" at the address " +
address +
": " +
e,
"[VMCHandler] Error connecting to port $portOut at the address $address: $e",

Comment on lines +364 to +376
val boneType = unityBone.boneType
if (boneType != null) {
// Get SlimeVR bone
val bone = humanPoseManager.getBone(boneType)

// Update unity hierarchy from bone's global
// rotation
outputUnityArmature!!
.setGlobalRotationForBone(
unityBone,
bone.getGlobalRotation().times(bone.rotationOffset.inv()),
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WHY IS THE CODE GETTING WORST

Suggested change
val boneType = unityBone.boneType
if (boneType != null) {
// Get SlimeVR bone
val bone = humanPoseManager.getBone(boneType)
// Update unity hierarchy from bone's global
// rotation
outputUnityArmature!!
.setGlobalRotationForBone(
unityBone,
bone.getGlobalRotation().times(bone.rotationOffset.inv()),
)
}
val boneType = unityBone.boneType ?: continue
// Get SlimeVR bone
val bone = humanPoseManager.getBone(boneType)
// Update unity hierarchy from bone's global
// rotation
outputUnityArmature!!
.setGlobalRotationForBone(
unityBone,
bone.getGlobalRotation() * bone.rotationOffset.inv(),
)

Comment on lines +384 to +391
val upperLegsAverage = outputUnityArmature
?.getHeadNodeOfBone(UnityBone.LEFT_UPPER_LEG)
?.worldTransform
?.translation
?.plus(
outputUnityArmature!!.getHeadNodeOfBone(UnityBone.RIGHT_UPPER_LEG)!!.worldTransform
.translation,
)?.times(0.5f)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants