These changes were initially made to improve performance. However,
on modern hardware, these changes turned out to make no difference.
This commit unifies the calculations in 'draw' and 'getDimension' and
adds comments to make it more understandable.
* Feature: Use the builtin profiler to automatically make zones for mod callback functions.
* Doc: Basic doc for builtin profiler, and better `/profiler` chatcommand help.
* Fix: `register_functions` (table of callback register function names), and `entity_instrumentation` is no longer outdated.
* Fix: Builtin profiler output is no longer printed to debug.txt or to file in world with translation escapes.
* Fix: Entity callback name generation used `obj_def.label` (normally non-existing field), now it uses the entity name.
* Small code improvements, like use of new `Settings.get_bool` with default.
A few functions tried to dereference a ServerEnvironment nullptr by
calling 'getEnv()'. This change makes use of a macro where possible.
This also cleans up incorrect macro uses, with no functional difference.
This change prevents issues arising from partial generation of MapChunks, which are liable to be regenerated completely when ungenerated MapBlocks within are encountered.
Co-authored-by: Po Lu <luangruo@yahoo.com>
Co-authored-by: sfan5 <sfan5@live.de>
Gimbal lock is a situation where the pitch (the middle angle) of the Tait-Bryan angles (usually called Euler angles incorrectly) is 90 degrees. If the angles specify a rotation close to gimbal lock, the precision requirements increase significantly, beyond what a single-precision float can provide, and at exactly gimbal lock, there's a loss of information. The test didn't take this into account. Fix this by decreasing the expected precision when close to gimbal lock.
The increased error rate on ARM Macs is probably caused by lesser precision in trigonometric functions. IEC-559 does not specify any semantics for those, and while Intel typically has a precision < 1 ulp for trigonometric functions with angles < 2*pi, it's likely that ARM's precision is a bit worse.