History

ObjectMotionState puts self on outgoing queue

Andrew Meadows committed 11 years ago

Commit 4977bfb1 parent 572ceb74 files · +24 −2Browse files

Showing the changes to libraries/physics/src/ObjectMotionState.cpp (1 of 4 files). Show all

Unified · Split

libraries/physics/src/ObjectMotionState.cpp+13−0
@@ -31,6 +31,7 @@ const float DEFAULT_RESTITUTION = 0.0f; · 30 unmodified lines
31 31
32// origin of physics simulation in world frame32// origin of physics simulation in world frame
33glm::vec3 _worldOffset(0.0f);33glm::vec3 _worldOffset(0.0f);
34QSet<ObjectMotionState*>* _outgoingPacketQueue;
34 35
35// static 36// static
36void ObjectMotionState::setWorldOffset(const glm::vec3& offset) {37void ObjectMotionState::setWorldOffset(const glm::vec3& offset) {
@@ -42,6 +43,18 @@ const glm::vec3& ObjectMotionState::getWorldOffset() { · 5 unmodified lines
42 return _worldOffset;43 return _worldOffset;
43}44}
44 45
46// static
47void ObjectMotionState::setOutgoingPacketQueue(QSet<ObjectMotionState*>* outgoing) {
48 assert(outgoing);
49 _outgoingPacketQueue = outgoing;
50}
51
52// static
53void ObjectMotionState::enqueueOutgoingPacket(ObjectMotionState* state) {
54 assert(_outgoingPacketQueue);
55 _outgoingPacketQueue->insert(state);
56}
57
45ObjectMotionState::ObjectMotionState() : 58ObjectMotionState::ObjectMotionState() :
46 _density(DEFAULT_DENSITY), 59 _density(DEFAULT_DENSITY),
47 _volume(DEFAULT_VOLUME), 60 _volume(DEFAULT_VOLUME),