diff options
Diffstat (limited to 'src/common/Collision/DynamicTree.cpp')
-rw-r--r-- | src/common/Collision/DynamicTree.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/common/Collision/DynamicTree.cpp b/src/common/Collision/DynamicTree.cpp index 38e10318a57..46dfdb1707e 100644 --- a/src/common/Collision/DynamicTree.cpp +++ b/src/common/Collision/DynamicTree.cpp @@ -41,20 +41,20 @@ int CHECK_TREE_PERIOD = 200; } // namespace template<> struct HashTrait< GameObjectModel>{ - static size_t hashCode(const GameObjectModel& g) { return (size_t)(void*)&g; } + static size_t hashCode(GameObjectModel const& g) { return (size_t)(void*)&g; } }; template<> struct PositionTrait< GameObjectModel> { - static void getPosition(const GameObjectModel& g, G3D::Vector3& p) { p = g.getPosition(); } + static void getPosition(GameObjectModel const& g, G3D::Vector3& p) { p = g.getPosition(); } }; template<> struct BoundsTrait< GameObjectModel> { - static void getBounds(const GameObjectModel& g, G3D::AABox& out) { out = g.getBounds();} - static void getBounds2(const GameObjectModel* g, G3D::AABox& out) { out = g->getBounds();} + static void getBounds(GameObjectModel const& g, G3D::AABox& out) { out = g.getBounds();} + static void getBounds2(GameObjectModel const* g, G3D::AABox& out) { out = g->getBounds();} }; /* -static bool operator == (const GameObjectModel& mdl, const GameObjectModel& mdl2){ +static bool operator==(GameObjectModel const& mdl, GameObjectModel const& mdl2){ return &mdl == &mdl2; } */ @@ -72,13 +72,13 @@ struct DynTreeImpl : public ParentTree/*, public Intersectable*/ { } - void insert(const Model& mdl) + void insert(Model const& mdl) { base::insert(mdl); ++unbalanced_times; } - void remove(const Model& mdl) + void remove(Model const& mdl) { base::remove(mdl); ++unbalanced_times; @@ -115,17 +115,17 @@ DynamicMapTree::~DynamicMapTree() delete impl; } -void DynamicMapTree::insert(const GameObjectModel& mdl) +void DynamicMapTree::insert(GameObjectModel const& mdl) { impl->insert(mdl); } -void DynamicMapTree::remove(const GameObjectModel& mdl) +void DynamicMapTree::remove(GameObjectModel const& mdl) { impl->remove(mdl); } -bool DynamicMapTree::contains(const GameObjectModel& mdl) const +bool DynamicMapTree::contains(GameObjectModel const& mdl) const { return impl->contains(mdl); } @@ -145,7 +145,7 @@ struct DynamicTreeIntersectionCallback bool did_hit; uint32 phase_mask; DynamicTreeIntersectionCallback(uint32 phasemask) : did_hit(false), phase_mask(phasemask) { } - bool operator()(const G3D::Ray& r, const GameObjectModel& obj, float& distance) + bool operator()(G3D::Ray const& r, GameObjectModel const& obj, float& distance) { did_hit = obj.intersectRay(r, distance, true, phase_mask, VMAP::ModelIgnoreFlags::Nothing); return did_hit; @@ -161,7 +161,7 @@ struct DynamicTreeIntersectionCallback_WithLogger { TC_LOG_DEBUG("maps", "Dynamic Intersection log"); } - bool operator()(const G3D::Ray& r, const GameObjectModel& obj, float& distance) + bool operator()(G3D::Ray const& r, GameObjectModel const& obj, float& distance) { TC_LOG_DEBUG("maps", "testing intersection with %s", obj.name.c_str()); bool hit = obj.intersectRay(r, distance, true, phase_mask, VMAP::ModelIgnoreFlags::Nothing); |