From 0bc0cfce5f61ccd3aa3d39a23ec8cd14950d04e1 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Wed, 28 Apr 2021 11:38:27 +0400 Subject: [PATCH] Declare separate constructors with const reference and rvalue arguments for OscillatingRecastMeshObject --- .../detournavigator/oscillatingrecastmeshobject.cpp | 9 ++++++++- .../detournavigator/oscillatingrecastmeshobject.hpp | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/components/detournavigator/oscillatingrecastmeshobject.cpp b/components/detournavigator/oscillatingrecastmeshobject.cpp index dd0b95600..5b8423183 100644 --- a/components/detournavigator/oscillatingrecastmeshobject.cpp +++ b/components/detournavigator/oscillatingrecastmeshobject.cpp @@ -4,13 +4,20 @@ namespace DetourNavigator { - OscillatingRecastMeshObject::OscillatingRecastMeshObject(RecastMeshObject impl, std::size_t lastChangeRevision) + OscillatingRecastMeshObject::OscillatingRecastMeshObject(RecastMeshObject&& impl, std::size_t lastChangeRevision) : mImpl(std::move(impl)) , mLastChangeRevision(lastChangeRevision) , mAabb(BulletHelpers::getAabb(mImpl.getShape(), mImpl.getTransform())) { } + OscillatingRecastMeshObject::OscillatingRecastMeshObject(const RecastMeshObject& impl, std::size_t lastChangeRevision) + : mImpl(impl) + , mLastChangeRevision(lastChangeRevision) + , mAabb(BulletHelpers::getAabb(mImpl.getShape(), mImpl.getTransform())) + { + } + bool OscillatingRecastMeshObject::update(const btTransform& transform, const AreaType areaType, std::size_t lastChangeRevision) { diff --git a/components/detournavigator/oscillatingrecastmeshobject.hpp b/components/detournavigator/oscillatingrecastmeshobject.hpp index 476fd4e0d..78a0c4b68 100644 --- a/components/detournavigator/oscillatingrecastmeshobject.hpp +++ b/components/detournavigator/oscillatingrecastmeshobject.hpp @@ -12,7 +12,8 @@ namespace DetourNavigator class OscillatingRecastMeshObject { public: - explicit OscillatingRecastMeshObject(RecastMeshObject impl, std::size_t lastChangeRevision); + explicit OscillatingRecastMeshObject(RecastMeshObject&& impl, std::size_t lastChangeRevision); + explicit OscillatingRecastMeshObject(const RecastMeshObject& impl, std::size_t lastChangeRevision); bool update(const btTransform& transform, const AreaType areaType, std::size_t lastChangeRevision);