diff options
author | Anton Yabchinskiy <arn@bestmx.ru> | 2015-07-29 23:01:36 +0300 |
---|---|---|
committer | Anton Yabchinskiy <arn@bestmx.ru> | 2015-07-29 23:01:36 +0300 |
commit | dc8df8a91a995796f0f330bf6bb6b209f6dfce08 (patch) | |
tree | 46cfe09124703b07860754d6b44e0289422e0573 /servers/physics_2d/broad_phase_2d_hash_grid.cpp | |
parent | 16746f157f83d666079ba3266acec13d35b84c3f (diff) | |
parent | 922356b903061cda7591090bf19e8346c3a78cf5 (diff) |
Merge branch 'master' of github.com:okamstudio/godot
Diffstat (limited to 'servers/physics_2d/broad_phase_2d_hash_grid.cpp')
-rw-r--r-- | servers/physics_2d/broad_phase_2d_hash_grid.cpp | 9 |
1 files changed, 5 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 0f08f63937..4651d485c2 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -467,9 +467,10 @@ int BroadPhase2DHashGrid::cull_segment(const Vector2& p_from, const Vector2& p_t delta.x=cell_size/delta.x; delta.y=cell_size/delta.y; - Point2i pos = p_from.floor() / cell_size; - Point2i end = p_to.floor() / cell_size; - Point2i step = Vector2( SGN(dir.x), SGN(dir.y)); + Point2i pos = (p_from/cell_size).floor(); + Point2i end = (p_to/cell_size).floor(); + + Point2i step = Vector2( SGN(dir.x), SGN(dir.y) ); Vector2 max; |