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
3131
3232 // origin of physics simulation in world frame
3333 glm::vec3 _worldOffset(0.0f);
34+QSet<ObjectMotionState*>* _outgoingPacketQueue;
3435
3536 // static
3637 void ObjectMotionState::setWorldOffset(const glm::vec3& offset) {
@@ -42,6 +43,18 @@ const glm::vec3& ObjectMotionState::getWorldOffset() { · 5 unmodified lines
4243 return _worldOffset;
4344 }
4445
46+// static
47+void ObjectMotionState::setOutgoingPacketQueue(QSet<ObjectMotionState*>* outgoing) {
48+ assert(outgoing);
49+ _outgoingPacketQueue = outgoing;
50+}
51+
52+// static
53+void ObjectMotionState::enqueueOutgoingPacket(ObjectMotionState* state) {
54+ assert(_outgoingPacketQueue);
55+ _outgoingPacketQueue->insert(state);
56+}
57+
4558 ObjectMotionState::ObjectMotionState() :
4659 _density(DEFAULT_DENSITY),
4760 _volume(DEFAULT_VOLUME),