From da48a5af20c21e41855c47cfc232ad1a4515196b Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 6 Apr 2018 11:10:23 -0700 Subject: [PATCH] fix compile errors and add PhysicsBoundary.cpp file --- interface/src/workload/PhysicsBoundary.cpp | 34 +++++++++++++++++++++ interface/src/workload/PhysicsBoundary.h | 35 ++++------------------ 2 files changed, 40 insertions(+), 29 deletions(-) create mode 100644 interface/src/workload/PhysicsBoundary.cpp diff --git a/interface/src/workload/PhysicsBoundary.cpp b/interface/src/workload/PhysicsBoundary.cpp new file mode 100644 index 0000000000..a62dfcf9f9 --- /dev/null +++ b/interface/src/workload/PhysicsBoundary.cpp @@ -0,0 +1,34 @@ +// +// PhysicsBoundary.h +// +// Created by Andrew Meadows 2018.04.05 +// Copyright 2018 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "PhysicsBoundary.h" + +#include +#include + +#include "workload/GameWorkload.h" + +void PhysicsBoundary::run(const workload::WorkloadContextPointer& context, const Inputs& inputs) { + auto space = context->_space; + if (!space) { + return; + } + GameWorkloadContext* gameContext = static_cast(context.get()); + PhysicalEntitySimulationPointer simulation = gameContext->_simulation; + const auto& regionChanges = inputs.get0(); + for (uint32_t i = 0; i < (uint32_t)regionChanges.size(); ++i) { + const workload::Space::Change& change = regionChanges[i]; + auto entity = space->getOwner(change.proxyId).get(); + if (entity) { + simulation->changeEntity(entity); + qCDebug(physics) << change.proxyId << " : " << "'" << entity->getName() << "' " << (uint32_t)(change.prevRegion) << " --> " << (uint32_t)(change.region); + } + } +} diff --git a/interface/src/workload/PhysicsBoundary.h b/interface/src/workload/PhysicsBoundary.h index 7eb3644375..c316fa5686 100644 --- a/interface/src/workload/PhysicsBoundary.h +++ b/interface/src/workload/PhysicsBoundary.h @@ -1,7 +1,7 @@ // // PhysicsBoundary.h // -// Created by Sam Gateau on 2/16/2018. +// Created by Andrew Meadows 2018.04.05 // Copyright 2018 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. @@ -10,13 +10,10 @@ #ifndef hifi_PhysicsGatekeeper_h #define hifi_PhysicsGatekeeper_h -#include "workload/Space.h" -#include "workload/Engine.h" - -#include "render/Scene.h" - -#include #include +#include +#include + #include "PhysicalEntitySimulation.h" class PhysicsBoundary { @@ -27,28 +24,8 @@ public: using JobModel = workload::Job::ModelI; // this doesn't work PhysicsBoundary() {} - - void configure(const Config& config) { - } - - void run(const workload::WorkloadContextPointer& context, const Inputs& inputs) { - auto space = context->_space; - if (!space) { - return; - } - GameWorkloadContext* gameContext = static_cast(context.get()); - PhysicalEntitySimulationPointer simulation = gameContext->_simulation; - const auto& regionChanges = inputs.get0(); - for (uint32_t i = 0; i < (uint32_t)regionChanges.size(); ++i) { - const workload::Space::Change& change = regionChanges[i]; - auto entity = space->getOwner(change.proxyId).get(); - if (entity) { - simulation->changeEntity(entity); - qCDebug("physics") << change.proxyId << " : " << "'" << entity->getName() << "' " - << (uint32_t)(change.prevRegion) << " --> " << (uint32_t)(change.region); - } - } - } + void configure(const Config& config) { } + void run(const workload::WorkloadContextPointer& context, const Inputs& inputs); }; #endif // hifi_PhysicsGatekeeper_h