diff options
author | Ferenc Arn <tagcup@yahoo.com> | 2017-01-14 14:35:39 -0600 |
---|---|---|
committer | Ferenc Arn <tagcup@yahoo.com> | 2017-01-16 13:36:33 -0600 |
commit | 6f4f9aa6ded6da027c84cc466c767334dc3d3362 (patch) | |
tree | 4d45d7e600a069d7feb2a2dae3a70d6b9ddbf884 /servers/physics_2d | |
parent | d13f2f9e25e380496e706b59720cd85eed299ca2 (diff) |
Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible.
Also inlined some more math functions.
Diffstat (limited to 'servers/physics_2d')
-rw-r--r-- | servers/physics_2d/broad_phase_2d_hash_grid.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp index d2b37319ad..8b7a410b3d 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -539,14 +539,14 @@ int BroadPhase2DHashGrid::cull_segment(const Vector2& p_from, const Vector2& p_t Vector2 max; if (dir.x<0) - max.x= (Math::floor(pos.x)*cell_size - p_from.x) / dir.x; + max.x= (Math::floor((double)pos.x)*cell_size - p_from.x) / dir.x; else - max.x= (Math::floor(pos.x + 1)*cell_size - p_from.x) / dir.x; + max.x= (Math::floor((double)pos.x + 1)*cell_size - p_from.x) / dir.x; if (dir.y<0) - max.y= (Math::floor(pos.y)*cell_size - p_from.y) / dir.y; + max.y= (Math::floor((double)pos.y)*cell_size - p_from.y) / dir.y; else - max.y= (Math::floor(pos.y + 1)*cell_size - p_from.y) / dir.y; + max.y= (Math::floor((double)pos.y + 1)*cell_size - p_from.y) / dir.y; int cullcount=0; _cull<false,true>(pos,Rect2(),p_from,p_to,p_results,p_max_results,p_result_indices,cullcount); |