mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:47:41 +02:00
_entityMotionStates is Qset of EntityMotionState*
This commit is contained in:
parent
f9ba4d355c
commit
d9f183458a
2 changed files with 5 additions and 6 deletions
|
@ -12,11 +12,11 @@
|
||||||
// TODO: make MotionState able to clear incoming flags
|
// TODO: make MotionState able to clear incoming flags
|
||||||
// TODO: make MotionState::setWorldTransform() put itself on _incomingChanges list
|
// TODO: make MotionState::setWorldTransform() put itself on _incomingChanges list
|
||||||
// TODO: give PhysicsEngine instance an _entityPacketSender
|
// TODO: give PhysicsEngine instance an _entityPacketSender
|
||||||
|
// TODO: provide some sort of "reliable" send for "stopped" update
|
||||||
|
|
||||||
#include "PhysicsEngine.h"
|
#include "PhysicsEngine.h"
|
||||||
#ifdef USE_BULLET_PHYSICS
|
#ifdef USE_BULLET_PHYSICS
|
||||||
|
|
||||||
#include "EntityMotionState.h"
|
|
||||||
#include "ShapeInfoUtil.h"
|
#include "ShapeInfoUtil.h"
|
||||||
#include "ThreadSafeDynamicsWorld.h"
|
#include "ThreadSafeDynamicsWorld.h"
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ void PhysicsEngine::removeEntityInternal(EntityItem* entity) {
|
||||||
assert(entity);
|
assert(entity);
|
||||||
void* physicsInfo = entity->getPhysicsInfo();
|
void* physicsInfo = entity->getPhysicsInfo();
|
||||||
if (physicsInfo) {
|
if (physicsInfo) {
|
||||||
ObjectMotionState* motionState = static_cast<ObjectMotionState*>(physicsInfo);
|
EntityMotionState* motionState = static_cast<EntityMotionState*>(physicsInfo);
|
||||||
removeObject(motionState);
|
removeObject(motionState);
|
||||||
entity->setPhysicsInfo(NULL);
|
entity->setPhysicsInfo(NULL);
|
||||||
_entityMotionStates.remove(motionState);
|
_entityMotionStates.remove(motionState);
|
||||||
|
@ -89,7 +89,7 @@ void PhysicsEngine::entityChangedInternal(EntityItem* entity) {
|
||||||
|
|
||||||
void PhysicsEngine::clearEntitiesInternal() {
|
void PhysicsEngine::clearEntitiesInternal() {
|
||||||
// For now we assume this would only be called on shutdown in which case we can just let the memory get lost.
|
// For now we assume this would only be called on shutdown in which case we can just let the memory get lost.
|
||||||
QSet<ObjectMotionState*>::const_iterator stateItr = _entityMotionStates.begin();
|
QSet<EntityMotionState*>::const_iterator stateItr = _entityMotionStates.begin();
|
||||||
for (stateItr = _entityMotionStates.begin(); stateItr != _entityMotionStates.end(); ++stateItr) {
|
for (stateItr = _entityMotionStates.begin(); stateItr != _entityMotionStates.end(); ++stateItr) {
|
||||||
removeObject(*stateItr);
|
removeObject(*stateItr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,7 @@ typedef unsigned int uint32_t;
|
||||||
#include <EntitySimulation.h>
|
#include <EntitySimulation.h>
|
||||||
|
|
||||||
#include "BulletUtil.h"
|
#include "BulletUtil.h"
|
||||||
#include "ObjectMotionState.h"
|
#include "EntityMotionState.h"
|
||||||
#include "ObjectMotionState.h"
|
|
||||||
#include "PositionHashKey.h"
|
#include "PositionHashKey.h"
|
||||||
#include "ShapeManager.h"
|
#include "ShapeManager.h"
|
||||||
#include "ThreadSafeDynamicsWorld.h"
|
#include "ThreadSafeDynamicsWorld.h"
|
||||||
|
@ -111,7 +110,7 @@ private:
|
||||||
btHashMap<PositionHashKey, VoxelObject> _voxels;
|
btHashMap<PositionHashKey, VoxelObject> _voxels;
|
||||||
|
|
||||||
// EntitySimulation stuff
|
// EntitySimulation stuff
|
||||||
QSet<ObjectMotionState*> _entityMotionStates; // all entities that we track
|
QSet<EntityMotionState*> _entityMotionStates; // all entities that we track
|
||||||
QSet<EntityItem*> _incomingEntityChanges; // entities with pending physics changes by script or packet
|
QSet<EntityItem*> _incomingEntityChanges; // entities with pending physics changes by script or packet
|
||||||
QSet<ObjectMotionState*> _outgoingPhysics; // MotionStates with pending transform changes from physics simulation
|
QSet<ObjectMotionState*> _outgoingPhysics; // MotionStates with pending transform changes from physics simulation
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue