diff --git a/components/detournavigator/recastmeshobject.cpp b/components/detournavigator/recastmeshobject.cpp index 862460b34b..8b4bc2fd6f 100644 --- a/components/detournavigator/recastmeshobject.cpp +++ b/components/detournavigator/recastmeshobject.cpp @@ -23,35 +23,35 @@ namespace DetourNavigator return result; } - std::vector makeChildrenObjects(const osg::ref_ptr& instance, + std::vector makeChildrenObjects(const osg::ref_ptr& holder, const btCompoundShape& shape, const AreaType areaType) { std::vector result; for (int i = 0, num = shape.getNumChildShapes(); i < num; ++i) { - const CollisionShape collisionShape {instance, *shape.getChildShape(i)}; + const CollisionShape collisionShape {holder, *shape.getChildShape(i)}; result.emplace_back(collisionShape, shape.getChildTransform(i), areaType); } return result; } - std::vector makeChildrenObjects(const osg::ref_ptr& instance, + std::vector makeChildrenObjects(const osg::ref_ptr& holder, const btCollisionShape& shape, const AreaType areaType) { if (shape.isCompound()) - return makeChildrenObjects(std::move(instance), static_cast(shape), areaType); + return makeChildrenObjects(holder, static_cast(shape), areaType); return std::vector(); } } RecastMeshObject::RecastMeshObject(const CollisionShape& shape, const btTransform& transform, const AreaType areaType) - : mShapeInstance(shape.getShapeInstance()) + : mHolder(shape.getHolder()) , mShape(shape.getShape()) , mTransform(transform) , mAreaType(areaType) , mLocalScaling(mShape.get().getLocalScaling()) - , mChildren(makeChildrenObjects(mShapeInstance, mShape.get(), mAreaType)) + , mChildren(makeChildrenObjects(mHolder, mShape.get(), mAreaType)) { } diff --git a/components/detournavigator/recastmeshobject.hpp b/components/detournavigator/recastmeshobject.hpp index 81199c5bad..445dfe50f5 100644 --- a/components/detournavigator/recastmeshobject.hpp +++ b/components/detournavigator/recastmeshobject.hpp @@ -3,11 +3,10 @@ #include "areatype.hpp" -#include - #include #include +#include #include #include @@ -20,16 +19,16 @@ namespace DetourNavigator class CollisionShape { public: - CollisionShape(osg::ref_ptr instance, const btCollisionShape& shape) - : mShapeInstance(std::move(instance)) + CollisionShape(osg::ref_ptr holder, const btCollisionShape& shape) + : mHolder(std::move(holder)) , mShape(shape) {} - const osg::ref_ptr& getShapeInstance() const { return mShapeInstance; } + const osg::ref_ptr& getHolder() const { return mHolder; } const btCollisionShape& getShape() const { return mShape; } private: - osg::ref_ptr mShapeInstance; + osg::ref_ptr mHolder; std::reference_wrapper mShape; }; @@ -56,7 +55,7 @@ namespace DetourNavigator } private: - osg::ref_ptr mShapeInstance; + osg::ref_ptr mHolder; std::reference_wrapper mShape; btTransform mTransform; AreaType mAreaType;