mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-20 05:49:05 +02:00
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
//
|
|
// AddEntityOperator.h
|
|
// libraries/entities/src
|
|
//
|
|
// Created by Brad Hefta-Gaub on 8/11/2014.
|
|
// Copyright 2014 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
|
|
//
|
|
|
|
#ifndef hifi_AddEntityOperator_h
|
|
#define hifi_AddEntityOperator_h
|
|
|
|
#include <memory>
|
|
|
|
#include <AABox.h>
|
|
#include <Octree.h>
|
|
|
|
#include "EntityTypes.h"
|
|
|
|
class EntityTree;
|
|
using EntityTreePointer = std::shared_ptr<EntityTree>;
|
|
|
|
class AddEntityOperator : public RecurseOctreeOperator {
|
|
public:
|
|
AddEntityOperator(EntityTreePointer tree, EntityItemPointer newEntity);
|
|
|
|
virtual bool preRecursion(const OctreeElementPointer& element) override;
|
|
virtual bool postRecursion(const OctreeElementPointer& element) override;
|
|
virtual OctreeElementPointer possiblyCreateChildAt(const OctreeElementPointer& element, int childIndex) override;
|
|
private:
|
|
EntityTreePointer _tree;
|
|
EntityItemPointer _newEntity;
|
|
AABox _newEntityBox;
|
|
bool _foundNew;
|
|
};
|
|
|
|
|
|
#endif // hifi_AddEntityOperator_h
|