Use OBB for Shield
hammy275 opened this issue ยท 3 comments
With OBBs implemented, I think it makes sense to use it for the shield. This should massively reduce the weirdness with shield detection. This will also finally be a good place to ensure roll works properly with OBBs, since no other Immersive using OBBs uses roll at the moment.
Note that we should also be doing a vector check on collision, since we shouldn't block a projectile if the shield isn't facing it.
For handling the shield hitbox rotation correctly, we need to do the following in order:
- Rotate by yaw on YN
- Rotate by pitch on XN.
- Rotate by roll on ZP
- Rotate by PI/2 (90 degrees) on YN to adjust for shield being on the side of the arm.
Shield positioning code will also need some work, but this is major progress!
Will need to redo OBB
s to be a set of rotations, rather than just a pitch, yaw, roll.
Multiple things to do actually:
- Downport
- Do better shield positioning
- Only reflect if in actual OBB. At the moment, we just reflect anything in the enclosing AABB, which is bad!
- Test with main hand