lovr icon indicating copy to clipboard operation
lovr copied to clipboard

Issue with Joint initialization

Open bjornbytes opened this issue 7 months ago • 1 comments

Background: In Jolt, when you create a slider, you have to specify a frame of reference for both colliders. This consists of a point (can be in world space or relative to the collider), a slider axis, and a normal axis.

We currently aren't specifying the 2 points at all, they're both at 0,0,0, which causes sliders to not behave as expected. There's an option called AutoDetectPoint, but we don't use it. I tried using it, but it picks a single anchor point between the two colliders, weighted by mass, which maybe isn't very useful. Instead, LÖVR should probably use the positions of the 2 colliders as the 2 points.

Additionally there's the issue of the slider axis and normal axis. We currently use a helper function SetSliderAxis for this, which computes the normal axis as any vector perpendicular to the main slider axis. This is probably okay.

bjornbytes avatar May 31 '25 02:05 bjornbytes

Similarly, we don't set the hinge normal axes. We should set both of those to be perpendicular to the hinge axis.

bjornbytes avatar May 31 '25 02:05 bjornbytes