mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 09:29:02 +02:00
move entityCollisionWithEntity to PhysicalEntitySimulation
This commit is contained in:
parent
542d1ad1ff
commit
6837d042ad
3 changed files with 5 additions and 8 deletions
|
@ -4679,7 +4679,7 @@ void Application::init() {
|
||||||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
|
|
||||||
// connect the _entityCollisionSystem to our EntityTreeRenderer since that's what handles running entity scripts
|
// connect the _entityCollisionSystem to our EntityTreeRenderer since that's what handles running entity scripts
|
||||||
connect(_entitySimulation.get(), &EntitySimulation::entityCollisionWithEntity,
|
connect(_entitySimulation.get(), &PhysicalEntitySimulation::entityCollisionWithEntity,
|
||||||
getEntities().data(), &EntityTreeRenderer::entityCollisionWithEntity);
|
getEntities().data(), &EntityTreeRenderer::entityCollisionWithEntity);
|
||||||
|
|
||||||
// connect the _entities (EntityTreeRenderer) to our script engine's EntityScriptingInterface for firing
|
// connect the _entities (EntityTreeRenderer) to our script engine's EntityScriptingInterface for firing
|
||||||
|
|
|
@ -43,7 +43,6 @@ const int DIRTY_SIMULATION_FLAGS =
|
||||||
Simulation::DIRTY_SIMULATOR_ID;
|
Simulation::DIRTY_SIMULATOR_ID;
|
||||||
|
|
||||||
class EntitySimulation : public QObject, public std::enable_shared_from_this<EntitySimulation> {
|
class EntitySimulation : public QObject, public std::enable_shared_from_this<EntitySimulation> {
|
||||||
Q_OBJECT
|
|
||||||
public:
|
public:
|
||||||
EntitySimulation() : _mutex(QMutex::Recursive), _entityTree(NULL), _nextExpiry(quint64(-1)) { }
|
EntitySimulation() : _mutex(QMutex::Recursive), _entityTree(NULL), _nextExpiry(quint64(-1)) { }
|
||||||
virtual ~EntitySimulation() { setEntityTree(NULL); }
|
virtual ~EntitySimulation() { setEntityTree(NULL); }
|
||||||
|
@ -57,8 +56,6 @@ public:
|
||||||
|
|
||||||
void updateEntities();
|
void updateEntities();
|
||||||
|
|
||||||
// friend class EntityTree;
|
|
||||||
|
|
||||||
virtual void addDynamic(EntityDynamicPointer dynamic);
|
virtual void addDynamic(EntityDynamicPointer dynamic);
|
||||||
virtual void removeDynamic(const QUuid dynamicID);
|
virtual void removeDynamic(const QUuid dynamicID);
|
||||||
virtual void removeDynamics(QList<QUuid> dynamicIDsToRemove);
|
virtual void removeDynamics(QList<QUuid> dynamicIDsToRemove);
|
||||||
|
@ -83,9 +80,6 @@ public:
|
||||||
/// \param entity pointer to EntityItem that needs to be put on the entitiesToDelete list and removed from others.
|
/// \param entity pointer to EntityItem that needs to be put on the entitiesToDelete list and removed from others.
|
||||||
virtual void prepareEntityForDelete(EntityItemPointer entity);
|
virtual void prepareEntityForDelete(EntityItemPointer entity);
|
||||||
|
|
||||||
signals:
|
|
||||||
void entityCollisionWithEntity(const EntityItemID& idA, const EntityItemID& idB, const Collision& collision);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// These pure virtual methods are protected because they are not to be called will-nilly. The base class
|
// These pure virtual methods are protected because they are not to be called will-nilly. The base class
|
||||||
// calls them in the right places.
|
// calls them in the right places.
|
||||||
|
@ -124,7 +118,6 @@ private:
|
||||||
|
|
||||||
|
|
||||||
SetOfEntities _entitiesToUpdate; // entities that need to call EntityItem::update()
|
SetOfEntities _entitiesToUpdate; // entities that need to call EntityItem::update()
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_EntitySimulation_h
|
#endif // hifi_EntitySimulation_h
|
||||||
|
|
|
@ -28,6 +28,7 @@ using PhysicalEntitySimulationPointer = std::shared_ptr<PhysicalEntitySimulation
|
||||||
using SetOfEntityMotionStates = QSet<EntityMotionState*>;
|
using SetOfEntityMotionStates = QSet<EntityMotionState*>;
|
||||||
|
|
||||||
class PhysicalEntitySimulation : public EntitySimulation {
|
class PhysicalEntitySimulation : public EntitySimulation {
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
PhysicalEntitySimulation();
|
PhysicalEntitySimulation();
|
||||||
~PhysicalEntitySimulation();
|
~PhysicalEntitySimulation();
|
||||||
|
@ -39,6 +40,9 @@ public:
|
||||||
|
|
||||||
virtual void takeEntitiesToDelete(VectorOfEntities& entitiesToDelete) override;
|
virtual void takeEntitiesToDelete(VectorOfEntities& entitiesToDelete) override;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void entityCollisionWithEntity(const EntityItemID& idA, const EntityItemID& idB, const Collision& collision);
|
||||||
|
|
||||||
protected: // only called by EntitySimulation
|
protected: // only called by EntitySimulation
|
||||||
// overrides for EntitySimulation
|
// overrides for EntitySimulation
|
||||||
virtual void updateEntitiesInternal(const quint64& now) override;
|
virtual void updateEntitiesInternal(const quint64& now) override;
|
||||||
|
|
Loading…
Reference in a new issue