diff --git a/library/phx/engine.cpp b/library/phx/engine.cpp index cf624f5649bf511076bd400694a41354051da84e..230ef47d7d941b29fa9d016226e965b0d7735f97 100644 --- a/library/phx/engine.cpp +++ b/library/phx/engine.cpp @@ -86,7 +86,7 @@ std::vector<Entity*> Engine::GetEntities() const { std::shared_ptr<Scene> Engine::GetScene() const { return scene_; } -void Engine::SetScene(const std::shared_ptr<Scene>& new_scene) { +void Engine::SetScene(std::shared_ptr<Scene> new_scene) { // detach from current scene if (scene_ != nullptr) { scene_->engine_ = nullptr; diff --git a/library/phx/engine.hpp b/library/phx/engine.hpp index ef29240009ffeadf6b275eaae74a32a92c0aad8e..02bb1f0752a0aa7699ee404b5d5d071751819052 100644 --- a/library/phx/engine.hpp +++ b/library/phx/engine.hpp @@ -108,7 +108,7 @@ class PHOENIX_EXPORT Engine final : public Loggable { std::string ToString() const override; bool IsRunning() const; - void SetScene(const std::shared_ptr<Scene>& new_scene); + void SetScene(std::shared_ptr<Scene> new_scene); std::shared_ptr<Scene> GetScene() const; // Parameters to the callback are: (old scene, new scene) boost::signals2::connection AddSceneChangedCallback( diff --git a/library/phx/openvr_controller_system.cpp b/library/phx/openvr_controller_system.cpp index f7e227e9489ee8639f316730eb36182c6ebb4470..1a915db2e44988921f731a786657cdd5e031b0ed 100644 --- a/library/phx/openvr_controller_system.cpp +++ b/library/phx/openvr_controller_system.cpp @@ -85,13 +85,13 @@ void OpenVRControllerSystem::Update(const FrameTimer::TimeInfo&) { if (left_controller_entity == nullptr) { // create that controller left_controller_entity = - AddController(scene, OpenVRControllerBehavior::LEFT); + AddController(scene.get(), OpenVRControllerBehavior::LEFT); } left_controller_active = true; } else if (role == vr::TrackedControllerRole_RightHand) { if (right_controller_entity == nullptr) { right_controller_entity = - AddController(scene, OpenVRControllerBehavior::RIGHT); + AddController(scene.get(), OpenVRControllerBehavior::RIGHT); } right_controller_active = true; } @@ -107,8 +107,7 @@ void OpenVRControllerSystem::Update(const FrameTimer::TimeInfo&) { } Entity* OpenVRControllerSystem::AddController( - const std::shared_ptr<phx::Scene>& scene, - OpenVRControllerBehavior::Side side) { + phx::Scene* scene, OpenVRControllerBehavior::Side side) { auto& resource_manager = ResourceManager::instance(); std::string side_string = side == OpenVRControllerBehavior::LEFT ? "left" : "right"; @@ -132,7 +131,7 @@ Entity* OpenVRControllerSystem::AddController( } Entity* OpenVRControllerSystem::AddControllerEntity( - const std::shared_ptr<phx::Scene>& scene, ResourcePointer<Mesh> mesh, + phx::Scene* scene, ResourcePointer<Mesh> mesh, ResourcePointer<Material> material, OpenVRControllerBehavior::Side side) { Entity* controller = scene->CreateEntity(); controller->AddComponent<MeshHandle>()->SetMesh(mesh); diff --git a/library/phx/openvr_controller_system.hpp b/library/phx/openvr_controller_system.hpp index 32a7d640dc435461edd67a85c3b5c2053a06fbb3..17f7cfd53707f4876766e7c8871e0ec3186a0553 100644 --- a/library/phx/openvr_controller_system.hpp +++ b/library/phx/openvr_controller_system.hpp @@ -58,11 +58,11 @@ class PHOENIX_EXPORT OpenVRControllerSystem : public System { OpenVRControllerSystem(Engine* engine, DisplaySystem* display_system); private: - static Entity* AddControllerEntity(const std::shared_ptr<phx::Scene>& scene, + static Entity* AddControllerEntity(phx::Scene* scene, ResourcePointer<Mesh> mesh, ResourcePointer<Material> material, OpenVRControllerBehavior::Side side); - static Entity* AddController(const std::shared_ptr<phx::Scene>& scene, + static Entity* AddController(phx::Scene* scene, OpenVRControllerBehavior::Side side); HMD* hmd_ = nullptr;