GarageGames / Torque3D

MIT Licensed Open Source version of Torque 3D from GarageGames
http://torque3d.org
MIT License
3.35k stars 1.2k forks source link

ExtendedMove packet cleanup #2273

Closed OTHGMars closed 6 years ago

OTHGMars commented 6 years ago

The ExtendedMove::pack() function will write 360 bits of data into every move packet even if no tracked devices are present. This can be verified by building a project with the TORQUE_EXTENDED_MOVE flag set, placing a breakpoint at https://github.com/GarageGames/Torque3D/blob/development/Engine/source/T3D/gameBase/extended/extendedMove.cpp#L148, launching the game with no tracked devices connected and stepping through to see every value get sent in full. All of the values being compared from the current move have already been clamped/unclamped and because of floating-point errors 0.0f != UNCLAMPPOS(CLAMPPOS( 0.0f )). This PR creates a clamped copy of the NullExtendedMove to use for comparisons in the pack function so the full extended tracking data is only sent for devices that are connected and tracking. The initial rotation values have been changed to reflect the change from QuatF to AngAxisF and prevent the mDegToRad() call here from causing an empty move to differ from the default.

jamesu commented 6 years ago

Looks good

OTHGMars commented 6 years ago

This PR is being withdrawn in favor of an ExtendedMove cleanup that will remove Euler rotations and mask off inactive devices eliminating the need for this.