mordentral / VRExpansionPlugin

A UE4-5 VR framework
https://www.vreue4.com
MIT License
522 stars 109 forks source link

Fix bMatchRotation for mirroring & bAlwaysInRange #16

Closed alexander-clarke closed 2 years ago

alexander-clarke commented 2 years ago

The main fix is that it was using GetComponentTransform rather than GetHandSocketTransform, meaning it wasn't using the mirrored hand socket for comparison.

Some other changes which aren't necessary but they're there if you wanted them: I changed GetGripSlotInRangeByTypeName_Component to use a USceneComponent as it didn't need to use a UPrimitiveComponent This then means that GetGripSlotInRangeByTypeName can call GetGripSlotInRangeByTypeName_Component with the root component which keeps the code a bit cleaner. If you don't take this change then you'll need to replicate the fix to GetGripSlotInRangeByTypeName.

Additionally bAlwaysInRange didn't work with bMatchRotation, so made it work with it as I assume that's the correct behaviour.

Some changes are just auto CRLF stuff, which I tried to undo but had difficulties with editor/git so left in for now. It does make it look like it's changing a lot more than it is which is annoying

mordentral commented 2 years ago

Aye good point on the code duplication on the socket search, generally I stick to UPrimitive because I enforce them for grips (several grip types don't work without them), however it makes sense in this case.

Also yeah good catch on it using the incorrect grip transform when mirrored.