Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 10 files). Show all
Unified · Split
| @@ -10,7 +10,6 @@ · 9 unmodified lines | ||
| 10 | 10 | |
| 11 | 11 | #include <SharedUtil.h> |
| 12 | 12 | |
| 13 | −#include <MetavoxelMessages.h> | |
| 14 | 13 | #include <MetavoxelUtil.h> |
| 15 | 14 | |
| 16 | 15 | #include "Application.h" |
| @@ -42,6 +41,12 @@ void MetavoxelSystem::init() { · 25 unmodified lines | ||
| 42 | 41 | _buffer.create(); |
| 43 | 42 | } |
| 44 | 43 | |
| 44 | +void MetavoxelSystem::applyEdit(const MetavoxelEdit& edit) { | |
| 45 | + foreach (MetavoxelClient* client, _clients) { | |
| 46 | + client->applyEdit(edit); | |
| 47 | + } | |
| 48 | +} | |
| 49 | + | |
| 45 | 50 | void MetavoxelSystem::processData(const QByteArray& data, const HifiSockAddr& sender) { |
| 46 | 51 | QMetaObject::invokeMethod(this, "receivedData", Q_ARG(const QByteArray&, data), Q_ARG(const HifiSockAddr&, sender)); |
| 47 | 52 | } |
| @@ -187,6 +192,14 @@ MetavoxelClient::MetavoxelClient(const HifiSockAddr& address) : · 139 unmodified lines | ||
| 187 | 192 | _receiveRecords.append(record); |
| 188 | 193 | } |
| 189 | 194 | |
| 195 | +void MetavoxelClient::applyEdit(const MetavoxelEdit& edit) { | |
| 196 | + // apply immediately to local tree | |
| 197 | + edit.apply(_data); | |
| 198 | + | |
| 199 | + // start sending it out | |
| 200 | + _sequencer.sendHighPriorityMessage(QVariant::fromValue(edit)); | |
| 201 | +} | |
| 202 | + | |
| 190 | 203 | void MetavoxelClient::simulate(float deltaTime, MetavoxelVisitor& visitor) { |
| 191 | 204 | Bitstream& out = _sequencer.startPacket(); |
| 192 | 205 | ClientStateMessage state = { Application::getInstance()->getCamera()->getPosition() }; |