diff options
Diffstat (limited to 'engines/bladerunner/scene_objects.cpp')
-rw-r--r-- | engines/bladerunner/scene_objects.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/engines/bladerunner/scene_objects.cpp b/engines/bladerunner/scene_objects.cpp index 4c038fa9c7..59df6c12b4 100644 --- a/engines/bladerunner/scene_objects.cpp +++ b/engines/bladerunner/scene_objects.cpp @@ -22,8 +22,12 @@ #include "bladerunner/scene_objects.h" +#include "bladerunner/bladerunner.h" + +#include "bladerunner/obstacles.h" #include "bladerunner/view.h" + namespace BladeRunner { SceneObjects::SceneObjects(BladeRunnerEngine *vm, View *view) { @@ -280,8 +284,18 @@ void SceneObjects::setIsTarget(int sceneObjectId, bool isTarget) { } -void SceneObjects::updateWalkpath() { - //TODO: implement +void SceneObjects::updateObstacles() { + _vm->_obstacles->clear(); + for(int i = 0; i < _count; i++) { + int index = _sceneObjectsSortedByDistance[i]; + SceneObject sceneObject = _sceneObjects[index]; + if(sceneObject._isObstacle) { + float x0, y0, z0, x1, y1, z1; + sceneObject._boundingBox.getXYZ(&x0, &y0, &z0, &x1, &y1, &z1); + _vm->_obstacles->add(x0, z0, x1, z1); + } + } + _vm->_obstacles->process(); } } // End of namespace BladeRunner |