aboutsummaryrefslogtreecommitdiff
path: root/build/android/src/main/res/values
diff options
context:
space:
mode:
authorJens Rottmann <30634967+JRottm@users.noreply.github.com>2017-08-05 01:42:39 +0200
committerSmallJoker <mk939@ymail.com>2018-06-03 17:31:59 +0200
commitb3ffe675c33104936dc3914d482942d5685f645e (patch)
tree9b34e93624e2e330821ad45db140689509b36802 /build/android/src/main/res/values
parent90a9e4e69fac32f368b275428fa42407ea9b7883 (diff)
downloadminetest-b3ffe675c33104936dc3914d482942d5685f645e.tar.gz
minetest-b3ffe675c33104936dc3914d482942d5685f645e.tar.bz2
minetest-b3ffe675c33104936dc3914d482942d5685f645e.zip
Add tiny Y offset in collisionMoveSimple() to tweak performance
Another small general problem: the player is always standing exactly on the bondary between 2 nodes e.g. Y=1.5 is exactly between nodes Y=1 and Y=2. floatToInt() and myround() will round +/-n.5 always 'outwards' to +/-(n+1), which means they behave differently depending on where you are: they round upwards above sea level and downwards when underground. This inconsistency comes from the way the coordinates are calculated, independent of the specific C++ code. The result is a tiny bit of lost performance when moving underground, because 1 node level more than necessary is checked for collisions. This can be amended by adding a tiny offset to minpos_f.Y, like @paramat suggested. This is not an elegant solution, but still better than wasting CPU.
Diffstat (limited to 'build/android/src/main/res/values')
0 files changed, 0 insertions, 0 deletions
='#n155'>155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206