History

repairs to MetavoxelSystem after reset to upstream

Stephen Birarda committed 11 years ago

Commit fa8b7021 parent c18c45a1 file · +175 −174Browse files

Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 1 file). Show all

Unified · Split

interface/src/MetavoxelSystem.cpp+175−174
@@ -40,13 +40,13 @@ REGISTER_META_OBJECT(StaticModelRenderer) · 39 unmodified lines
4040 REGISTER_META_OBJECT(HeightfieldRenderer)
4141
4242 MetavoxelSystem::NetworkSimulation::NetworkSimulation(float dropRate, float repeatRate,
43− int minimumDelay, int maximumDelay, int bandwidthLimit) :
44−dropRate(dropRate),
45−repeatRate(repeatRate),
46−minimumDelay(minimumDelay),
47−maximumDelay(maximumDelay),
48−bandwidthLimit(bandwidthLimit) {
49−}
43+ int minimumDelay, int maximumDelay, int bandwidthLimit) :
44+ dropRate(dropRate),
45+ repeatRate(repeatRate),
46+ minimumDelay(minimumDelay),
47+ maximumDelay(maximumDelay),
48+ bandwidthLimit(bandwidthLimit) {
49+}
5050
5151 MetavoxelSystem::~MetavoxelSystem() {
5252 // kill the updater before we delete our network simulation objects
@@ -59,14 +59,14 @@ void MetavoxelSystem::init() { · 6 unmodified lines
5959 MetavoxelClientManager::init();
6060
6161 _voxelBufferAttribute = AttributeRegistry::getInstance()->registerAttribute(
62− new BufferDataAttribute("voxelBuffer"));
62+ new BufferDataAttribute("voxelBuffer"));
6363 _voxelBufferAttribute->setLODThresholdMultiplier(
64− AttributeRegistry::getInstance()->getVoxelColorAttribute()->getLODThresholdMultiplier());
65−
64+ AttributeRegistry::getInstance()->getVoxelColorAttribute()->getLODThresholdMultiplier());
65+
6666 _baseHeightfieldProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() +
67− "shaders/metavoxel_heightfield_base.vert");
67+ "shaders/metavoxel_heightfield_base.vert");
6868 _baseHeightfieldProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() +
69− "shaders/metavoxel_heightfield_base.frag");
69+ "shaders/metavoxel_heightfield_base.frag");
7070 _baseHeightfieldProgram.link();
7171
7272 _baseHeightfieldProgram.bind();
@@ -79,9 +79,9 @@ void MetavoxelSystem::init() { · 6 unmodified lines
7979 loadSplatProgram("heightfield", _splatHeightfieldProgram, _splatHeightfieldLocations);
8080
8181 _heightfieldCursorProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() +
82− "shaders/metavoxel_heightfield_cursor.vert");
82+ "shaders/metavoxel_heightfield_cursor.vert");
8383 _heightfieldCursorProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() +
84− "shaders/metavoxel_cursor.frag");
84+ "shaders/metavoxel_cursor.frag");
8585 _heightfieldCursorProgram.link();
8686
8787 _heightfieldCursorProgram.bind();
@@ -89,17 +89,17 @@ void MetavoxelSystem::init() { · 1 unmodified line
8989 _heightfieldCursorProgram.release();
9090
9191 _baseVoxelProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() +
92− "shaders/metavoxel_voxel_base.vert");
92+ "shaders/metavoxel_voxel_base.vert");
9393 _baseVoxelProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() +
94− "shaders/metavoxel_voxel_base.frag");
94+ "shaders/metavoxel_voxel_base.frag");
9595 _baseVoxelProgram.link();
9696
9797 loadSplatProgram("voxel", _splatVoxelProgram, _splatVoxelLocations);
9898
9999 _voxelCursorProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() +
100− "shaders/metavoxel_voxel_cursor.vert");
100+ "shaders/metavoxel_voxel_cursor.vert");
101101 _voxelCursorProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() +
102− "shaders/metavoxel_cursor.frag");
102+ "shaders/metavoxel_cursor.frag");
103103 _voxelCursorProgram.link();
104104 }
105105
@@ -124,16 +124,16 @@ public: · 18 unmodified lines
124124 SimulateVisitor(float deltaTime, const MetavoxelLOD& lod);
125125
126126 virtual int visit(MetavoxelInfo& info);
127−
127+
128128 private:
129129
130130 float _deltaTime;
131131 };
132132
133133 SimulateVisitor::SimulateVisitor(float deltaTime, const MetavoxelLOD& lod) :
134−MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(),
135− QVector<AttributePointer>(), lod),
136−_deltaTime(deltaTime) {
134+ MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(),
135+ QVector<AttributePointer>(), lod),
136+ _deltaTime(deltaTime) {
137137 }
138138
139139 int SimulateVisitor::visit(MetavoxelInfo& info) {
@@ -141,7 +141,7 @@ int SimulateVisitor::visit(MetavoxelInfo& info) { · 1 unmodified line
141141 return DEFAULT_ORDER;
142142 }
143143 static_cast<MetavoxelRenderer*>(info.inputValues.at(0).getInlineValue<
144− SharedObjectPointer>().data())->getImplementation()->simulate(*_data, _deltaTime, info, _lod);
144+ SharedObjectPointer>().data())->getImplementation()->simulate(*_data, _deltaTime, info, _lod);
145145 return STOP_RECURSION;
146146 }
147147
@@ -152,7 +152,7 @@ void MetavoxelSystem::simulate(float deltaTime) { · 4 unmodified lines
152152 const float DEFAULT_LOD_THRESHOLD = 0.01f;
153153 _lod = MetavoxelLOD(Application::getInstance()->getCamera()->getPosition(), DEFAULT_LOD_THRESHOLD);
154154 }
155−
155+
156156 SimulateVisitor simulateVisitor(deltaTime, getLOD());
157157 guideToAugmented(simulateVisitor);
158158 }
@@ -166,8 +166,8 @@ public: · 7 unmodified lines
166166 };
167167
168168 RenderVisitor::RenderVisitor(const MetavoxelLOD& lod) :
169−MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(),
170− QVector<AttributePointer>(), lod) {
169+ MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(),
170+ QVector<AttributePointer>(), lod) {
171171 }
172172
173173 int RenderVisitor::visit(MetavoxelInfo& info) {
@@ -175,7 +175,7 @@ int RenderVisitor::visit(MetavoxelInfo& info) { · 1 unmodified line
175175 return DEFAULT_ORDER;
176176 }
177177 static_cast<MetavoxelRenderer*>(info.inputValues.at(0).getInlineValue<
178− SharedObjectPointer>().data())->getImplementation()->render(*_data, info, _lod);
178+ SharedObjectPointer>().data())->getImplementation()->render(*_data, info, _lod);
179179 return STOP_RECURSION;
180180 }
181181
@@ -195,18 +195,18 @@ void MetavoxelSystem::render() { · 13 unmodified lines
195195 // update the frustum
196196 ViewFrustum* viewFrustum = Application::getInstance()->getDisplayViewFrustum();
197197 _frustum.set(viewFrustum->getFarTopLeft(), viewFrustum->getFarTopRight(), viewFrustum->getFarBottomLeft(),
198− viewFrustum->getFarBottomRight(), viewFrustum->getNearTopLeft(), viewFrustum->getNearTopRight(),
199− viewFrustum->getNearBottomLeft(), viewFrustum->getNearBottomRight());
200−
198+ viewFrustum->getFarBottomRight(), viewFrustum->getNearTopLeft(), viewFrustum->getNearTopRight(),
199+ viewFrustum->getNearBottomLeft(), viewFrustum->getNearBottomRight());
200+
201201 RenderVisitor renderVisitor(getLOD());
202202 guideToAugmented(renderVisitor, true);
203203
204204 if (!_heightfieldBaseBatches.isEmpty()) {
205205 glEnableClientState(GL_VERTEX_ARRAY);
206206 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
207−
207+
208208 Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(true, true);
209−
209+
210210 glDisable(GL_BLEND);
211211 glEnable(GL_CULL_FACE);
212212 glEnable(GL_ALPHA_TEST);
@@ -225,7 +225,7 @@ void MetavoxelSystem::render() { · 12 unmodified lines
225225
226226 batch.vertexBuffer->bind();
227227 batch.indexBuffer->bind();
228−
228+
229229 HeightfieldPoint* point = 0;
230230 glVertexPointer(3, GL_FLOAT, sizeof(HeightfieldPoint), &point->vertex);
231231 glTexCoordPointer(2, GL_FLOAT, sizeof(HeightfieldPoint), &point->textureCoord);
@@ -234,7 +234,7 @@ void MetavoxelSystem::render() { · 2 unmodified lines
234234
235235 _baseHeightfieldProgram.setUniform(_baseHeightScaleLocation, batch.heightScale);
236236 _baseHeightfieldProgram.setUniform(_baseColorScaleLocation, batch.colorScale);
237−
237+
238238 glActiveTexture(GL_TEXTURE1);
239239 glBindTexture(GL_TEXTURE_2D, batch.colorTextureID);
240240
@@ -244,10 +244,10 @@ void MetavoxelSystem::render() { · 3 unmodified lines
244244
245245 glActiveTexture(GL_TEXTURE0);
246246 glBindTexture(GL_TEXTURE_2D, 0);
247−
247+
248248 batch.vertexBuffer->release();
249249 batch.indexBuffer->release();
250−
250+
251251 glPopMatrix();
252252 }
253253
@@ -275,7 +275,7 @@ void MetavoxelSystem::render() { · 21 unmodified lines
275275
276276 batch.vertexBuffer->bind();
277277 batch.indexBuffer->bind();
278−
278+
279279 HeightfieldPoint* point = 0;
280280 glVertexPointer(3, GL_FLOAT, sizeof(HeightfieldPoint), &point->vertex);
281281 glTexCoordPointer(2, GL_FLOAT, sizeof(HeightfieldPoint), &point->textureCoord);
@@ -283,7 +283,7 @@ void MetavoxelSystem::render() { · 1 unmodified line
283283 glBindTexture(GL_TEXTURE_2D, batch.heightTextureID);
284284
285285 _splatHeightfieldProgram.setUniformValue(_splatHeightfieldLocations.heightScale,
286− batch.heightScale.x, batch.heightScale.y);
286+ batch.heightScale.x, batch.heightScale.y);
287287 _splatHeightfieldProgram.setUniform(_splatHeightfieldLocations.textureScale, batch.textureScale);
288288 _splatHeightfieldProgram.setUniform(_splatHeightfieldLocations.splatTextureOffset, batch.splatTextureOffset);
289289
@@ -291,18 +291,18 @@ void MetavoxelSystem::render() { · 1 unmodified line
291291 _splatHeightfieldProgram.setUniform(_splatHeightfieldLocations.splatTextureScalesS, batch.splatTextureScalesS);
292292 _splatHeightfieldProgram.setUniform(_splatHeightfieldLocations.splatTextureScalesT, batch.splatTextureScalesT);
293293 _splatHeightfieldProgram.setUniformValue(
294− _splatHeightfieldLocations.textureValueMinima,
295− (batch.materialIndex + 1) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP,
296− (batch.materialIndex + 2) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP,
297− (batch.materialIndex + 3) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP,
298− (batch.materialIndex + 4) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP);
294+ _splatHeightfieldLocations.textureValueMinima,
295+ (batch.materialIndex + 1) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP,
296+ (batch.materialIndex + 2) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP,
297+ (batch.materialIndex + 3) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP,
298+ (batch.materialIndex + 4) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP);
299299 _splatHeightfieldProgram.setUniformValue(
300− _splatHeightfieldLocations.textureValueMaxima,
301− (batch.materialIndex + 1) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP,
302− (batch.materialIndex + 2) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP,
303− (batch.materialIndex + 3) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP,
304− (batch.materialIndex + 4) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP);
305−
300+ _splatHeightfieldLocations.textureValueMaxima,
301+ (batch.materialIndex + 1) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP,
302+ (batch.materialIndex + 2) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP,
303+ (batch.materialIndex + 3) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP,
304+ (batch.materialIndex + 4) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP);
305+
306306 glActiveTexture(GL_TEXTURE1);
307307 glBindTexture(GL_TEXTURE_2D, batch.materialTextureID);
308308
@@ -312,22 +312,22 @@ void MetavoxelSystem::render() { · 3 unmodified lines
312312 }
313313
314314 glDrawRangeElements(GL_TRIANGLES, 0, batch.vertexCount - 1, batch.indexCount, GL_UNSIGNED_INT, 0);
315−
315+
316316 for (int i = 0; i < SPLAT_COUNT; i++) {
317317 glActiveTexture(GL_TEXTURE0 + SPLAT_TEXTURE_UNITS[i]);
318318 glBindTexture(GL_TEXTURE_2D, 0);
319319 }
320−
320+
321321 glActiveTexture(GL_TEXTURE1);
322322 glBindTexture(GL_TEXTURE_2D, 0);
323−
323+
324324 glActiveTexture(GL_TEXTURE0);
325325 glBindTexture(GL_TEXTURE_2D, 0);
326−
326+
327327 batch.vertexBuffer->release();
328328 batch.indexBuffer->release();
329329
330− glPopMatrix();
330+ glPopMatrix();
331331 }
332332
333333 _splatHeightfieldProgram.release();
@@ -341,15 +341,15 @@ void MetavoxelSystem::render() { · 7 unmodified lines
341341
342342 glDisable(GL_CULL_FACE);
343343
344− glDisableClientState(GL_TEXTURE_COORD_ARRAY);
345− glDisableClientState(GL_VERTEX_ARRAY);
344+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
345+ glDisableClientState(GL_VERTEX_ARRAY);
346346
347347 _heightfieldBaseBatches.clear();
348348 }
349349
350350 if (!_voxelBaseBatches.isEmpty()) {
351351 Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(true, true);
352−
352+
353353 glEnableClientState(GL_VERTEX_ARRAY);
354354 glDisable(GL_BLEND);
355355 glEnable(GL_CULL_FACE);
@@ -360,7 +360,7 @@ void MetavoxelSystem::render() { · 4 unmodified lines
360360
361361 glEnableClientState(GL_COLOR_ARRAY);
362362 glEnableClientState(GL_NORMAL_ARRAY);
363−
363+
364364 _baseVoxelProgram.bind();
365365
366366 foreach (const VoxelBatch& batch, _voxelBaseBatches) {
@@ -379,10 +379,10 @@ void MetavoxelSystem::render() { · 12 unmodified lines
379379 }
380380
381381 _baseVoxelProgram.release();
382−
382+
383383 glDisable(GL_ALPHA_TEST);
384384 glEnable(GL_BLEND);
385−
385+
386386 Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(true, false);
387387
388388 if (!_voxelSplatBatches.isEmpty()) {
@@ -406,25 +406,25 @@ void MetavoxelSystem::render() { · 17 unmodified lines
406406 glNormalPointer(GL_BYTE, sizeof(VoxelPoint), &point->normal);
407407
408408 _splatVoxelProgram.setAttributeBuffer(_splatVoxelLocations.materials,
409− GL_UNSIGNED_BYTE, (qint64)&point->materials, SPLAT_COUNT, sizeof(VoxelPoint));
409+ GL_UNSIGNED_BYTE, (qint64)&point->materials, SPLAT_COUNT, sizeof(VoxelPoint));
410410 _splatVoxelProgram.setAttributeBuffer(_splatVoxelLocations.materialWeights,
411− GL_UNSIGNED_BYTE, (qint64)&point->materialWeights, SPLAT_COUNT, sizeof(VoxelPoint));
411+ GL_UNSIGNED_BYTE, (qint64)&point->materialWeights, SPLAT_COUNT, sizeof(VoxelPoint));
412412
413413 const float QUARTER_STEP = 0.25f * EIGHT_BIT_MAXIMUM_RECIPROCAL;
414414 _splatVoxelProgram.setUniform(_splatVoxelLocations.splatTextureScalesS, batch.splatTextureScalesS);
415415 _splatVoxelProgram.setUniform(_splatVoxelLocations.splatTextureScalesT, batch.splatTextureScalesT);
416416 _splatVoxelProgram.setUniformValue(
417− _splatVoxelLocations.textureValueMinima,
418− (batch.materialIndex + 1) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP,
419− (batch.materialIndex + 2) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP,
420− (batch.materialIndex + 3) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP,
421− (batch.materialIndex + 4) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP);
417+ _splatVoxelLocations.textureValueMinima,
418+ (batch.materialIndex + 1) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP,
419+ (batch.materialIndex + 2) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP,
420+ (batch.materialIndex + 3) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP,
421+ (batch.materialIndex + 4) * EIGHT_BIT_MAXIMUM_RECIPROCAL - QUARTER_STEP);
422422 _splatVoxelProgram.setUniformValue(
423− _splatVoxelLocations.textureValueMaxima,
424− (batch.materialIndex + 1) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP,
425− (batch.materialIndex + 2) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP,
426− (batch.materialIndex + 3) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP,
427− (batch.materialIndex + 4) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP);
423+ _splatVoxelLocations.textureValueMaxima,
424+ (batch.materialIndex + 1) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP,
425+ (batch.materialIndex + 2) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP,
426+ (batch.materialIndex + 3) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP,
427+ (batch.materialIndex + 4) * EIGHT_BIT_MAXIMUM_RECIPROCAL + QUARTER_STEP);
428428
429429 for (int i = 0; i < SPLAT_COUNT; i++) {
430430 glActiveTexture(GL_TEXTURE0 + SPLAT_TEXTURE_UNITS[i]);
@@ -437,9 +437,9 @@ void MetavoxelSystem::render() { · 6 unmodified lines
437437 glActiveTexture(GL_TEXTURE0 + SPLAT_TEXTURE_UNITS[i]);
438438 glBindTexture(GL_TEXTURE_2D, 0);
439439 }
440−
440+
441441 glActiveTexture(GL_TEXTURE0);
442−
442+
443443 batch.vertexBuffer->release();
444444 batch.indexBuffer->release();
445445 }
@@ -517,10 +517,10 @@ public: · 71 unmodified lines
517517 };
518518
519519 RayVoxelIntersectionVisitor::RayVoxelIntersectionVisitor(const glm::vec3& origin,
520− const glm::vec3& direction, const MetavoxelLOD& lod) :
521−RayIntersectionVisitor(origin, direction, QVector<AttributePointer>() <<
522− Application::getInstance()->getMetavoxels()->getVoxelBufferAttribute(), QVector<AttributePointer>(), lod),
523−intersectionDistance(FLT_MAX) {
520+ const glm::vec3& direction, const MetavoxelLOD& lod) :
521+ RayIntersectionVisitor(origin, direction, QVector<AttributePointer>() <<
522+ Application::getInstance()->getMetavoxels()->getVoxelBufferAttribute(), QVector<AttributePointer>(), lod),
523+ intersectionDistance(FLT_MAX) {
524524 }
525525
526526 int RayVoxelIntersectionVisitor::visit(MetavoxelInfo& info, float distance) {
@@ -528,7 +528,7 @@ int RayVoxelIntersectionVisitor::visit(MetavoxelInfo& info, float distance) { · 1 unmodified line
528528 return _order;
529529 }
530530 const VoxelBuffer* buffer = static_cast<VoxelBuffer*>(
531− info.inputValues.at(0).getInlineValue<BufferDataPointer>().data());
531+ info.inputValues.at(0).getInlineValue<BufferDataPointer>().data());
532532 if (!buffer) {
533533 return STOP_RECURSION;
534534 }
@@ -630,7 +630,7 @@ public: · 95 unmodified lines
630630 virtual bool visit(Spanner* spanner);
631631
632632 virtual int visit(MetavoxelInfo& info);
633−
633+
634634 private:
635635
636636 Box _bounds;
@@ -693,17 +693,17 @@ class BufferCursorRenderVisitor : public MetavoxelVisitor { · 56 unmodified lines
693693 public:
694694
695695 BufferCursorRenderVisitor(const AttributePointer& attribute, const Box& bounds);
696−
696+
697697 virtual int visit(MetavoxelInfo& info);
698−
698+
699699 private:
700700
701701 Box _bounds;
702702 };
703703
704704 BufferCursorRenderVisitor::BufferCursorRenderVisitor(const AttributePointer& attribute, const Box& bounds) :
705−MetavoxelVisitor(QVector<AttributePointer>() << attribute),
706−_bounds(bounds) {
705+ MetavoxelVisitor(QVector<AttributePointer>() << attribute),
706+ _bounds(bounds) {
707707 }
708708
709709 int BufferCursorRenderVisitor::visit(MetavoxelInfo& info) {
@@ -766,11 +766,11 @@ void MetavoxelSystem::renderVoxelCursor(const glm::vec3& position, float radius) · 56 unmodified lines
766766
767767 class MaterialEditApplier : public SignalHandler {
768768 public:
769−
769+
770770 MaterialEditApplier(const MetavoxelEditMessage& message, const QSharedPointer<NetworkTexture> texture);
771771
772772 virtual void handle();
773−
773+
774774 protected:
775775
776776 MetavoxelEditMessage _message;
@@ -778,8 +778,8 @@ protected: · 1 unmodified line
778778 };
779779
780780 MaterialEditApplier::MaterialEditApplier(const MetavoxelEditMessage& message, const QSharedPointer<NetworkTexture> texture) :
781−_message(message),
782−_texture(texture) {
781+ _message(message),
782+ _texture(texture) {
783783 }
784784
785785 void MaterialEditApplier::handle() {
@@ -794,16 +794,16 @@ void MetavoxelSystem::applyMaterialEdit(const MetavoxelEditMessage& message, boo · 8 unmodified lines
794794 if (material && material->getDiffuse().isValid()) {
795795 if (QThread::currentThread() != thread()) {
796796 QMetaObject::invokeMethod(this, "applyMaterialEdit", Q_ARG(const MetavoxelEditMessage&, message),
797− Q_ARG(bool, reliable));
797+ Q_ARG(bool, reliable));
798798 return;
799799 }
800800 QSharedPointer<NetworkTexture> texture = Application::getInstance()->getTextureCache()->getTexture(
801− material->getDiffuse(), SPLAT_TEXTURE);
801+ material->getDiffuse(), SPLAT_TEXTURE);
802802 if (texture->isLoaded()) {
803803 MetavoxelEditMessage newMessage = message;
804804 static_cast<MaterialEdit*>(newMessage.edit.data())->averageColor = texture->getAverageColor();
805− applyEdit(newMessage, true);
806−
805+ applyEdit(newMessage, true);
806+
807807 } else {
808808 MaterialEditApplier* applier = new MaterialEditApplier(message, texture);
809809 connect(texture.data(), &Resource::loaded, applier, &SignalHandler::handle);
@@ -818,7 +818,7 @@ MetavoxelClient* MetavoxelSystem::createClient(const SharedNodePointer& node) { · 8 unmodified lines
818818 }
819819
820820 void MetavoxelSystem::guideToAugmented(MetavoxelVisitor& visitor, bool render) {
821− NodeList::getInstance()->eachNode([&visitor, &render](const SharedNodePointer& node) {
821+ NodeList::getInstance()->eachNode([&visitor, &render](const SharedNodePointer& node){
822822 if (node->getType() == NodeType::MetavoxelServer) {
823823 QMutexLocker locker(&node->getMutex());
824824 MetavoxelSystemClient* client = static_cast<MetavoxelSystemClient*>(node->getLinkedData());
@@ -837,9 +837,9 @@ void MetavoxelSystem::guideToAugmented(MetavoxelVisitor& visitor, bool render) { · 12 unmodified lines
837837
838838 void MetavoxelSystem::loadSplatProgram(const char* type, ProgramObject& program, SplatLocations& locations) {
839839 program.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() +
840− "shaders/metavoxel_" + type + "_splat.vert");
840+ "shaders/metavoxel_" + type + "_splat.vert");
841841 program.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() +
842− "shaders/metavoxel_" + type + "_splat.frag");
842+ "shaders/metavoxel_" + type + "_splat.frag");
843843 program.link();
844844
845845 program.bind();
@@ -859,8 +859,8 @@ void MetavoxelSystem::loadSplatProgram(const char* type, ProgramObject& program, · 13 unmodified lines
859859 }
860860
861861 Throttle::Throttle() :
862−_limit(INT_MAX),
863−_total(0) {
862+ _limit(INT_MAX),
863+ _total(0) {
864864 }
865865
866866 bool Throttle::shouldThrottle(int bytes) {
@@ -881,7 +881,7 @@ bool Throttle::shouldThrottle(int bytes) { · 14 unmodified lines
881881 }
882882
883883 MetavoxelSystemClient::MetavoxelSystemClient(const SharedNodePointer& node, MetavoxelUpdater* updater) :
884−MetavoxelClient(node, updater) {
884+ MetavoxelClient(node, updater) {
885885 }
886886
887887 void MetavoxelSystemClient::setAugmentedData(const MetavoxelData& data) {
@@ -898,11 +898,11 @@ class ReceiveDelayer : public QObject { · 10 unmodified lines
898898 public:
899899
900900 ReceiveDelayer(const SharedNodePointer& node, const QByteArray& packet);
901−
901+
902902 protected:
903−
903+
904904 virtual void timerEvent(QTimerEvent* event);
905−
905+
906906 private:
907907
908908 SharedNodePointer _node;
@@ -910,8 +910,8 @@ private: · 1 unmodified line
910910 };
911911
912912 ReceiveDelayer::ReceiveDelayer(const SharedNodePointer& node, const QByteArray& packet) :
913−_node(node),
914−_packet(packet) {
913+ _node(node),
914+ _packet(packet) {
915915 }
916916
917917 void ReceiveDelayer::timerEvent(QTimerEvent* event) {
@@ -956,16 +956,16 @@ public: · 38 unmodified lines
956956 AugmentVisitor(const MetavoxelLOD& lod, const MetavoxelData& previousData);
957957
958958 virtual int visit(MetavoxelInfo& info);
959−
959+
960960 private:
961961
962962 const MetavoxelData& _previousData;
963963 };
964964
965965 AugmentVisitor::AugmentVisitor(const MetavoxelLOD& lod, const MetavoxelData& previousData) :
966−MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(),
967− QVector<AttributePointer>(), lod),
968−_previousData(previousData) {
966+ MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(),
967+ QVector<AttributePointer>(), lod),
968+ _previousData(previousData) {
969969 }
970970
971971 int AugmentVisitor::visit(MetavoxelInfo& info) {
@@ -973,7 +973,7 @@ int AugmentVisitor::visit(MetavoxelInfo& info) { · 1 unmodified line
973973 return DEFAULT_ORDER;
974974 }
975975 static_cast<MetavoxelRenderer*>(info.inputValues.at(0).getInlineValue<
976− SharedObjectPointer>().data())->getImplementation()->augment(*_data, _previousData, info, _lod);
976+ SharedObjectPointer>().data())->getImplementation()->augment(*_data, _previousData, info, _lod);
977977 return STOP_RECURSION;
978978 }
979979
@@ -981,10 +981,10 @@ class Augmenter : public QRunnable { · 1 unmodified line
981981 public:
982982
983983 Augmenter(const SharedNodePointer& node, const MetavoxelData& data,
984− const MetavoxelData& previousData, const MetavoxelLOD& lod);
984+ const MetavoxelData& previousData, const MetavoxelLOD& lod);
985985
986986 virtual void run();
987−
987+
988988 private:
989989
990990 QWeakPointer<Node> _node;
@@ -994,11 +994,11 @@ private: · 3 unmodified lines
994994 };
995995
996996 Augmenter::Augmenter(const SharedNodePointer& node, const MetavoxelData& data,
997− const MetavoxelData& previousData, const MetavoxelLOD& lod) :
998−_node(node),
999−_data(data),
1000−_previousData(previousData),
1001−_lod(lod) {
997+ const MetavoxelData& previousData, const MetavoxelLOD& lod) :
998+ _node(node),
999+ _data(data),
1000+ _previousData(previousData),
1001+ _lod(lod) {
10021002 }
10031003
10041004 void Augmenter::run() {
@@ -1016,7 +1016,7 @@ void MetavoxelSystemClient::refreshVoxelData() { · 11 unmodified lines
10161016 // make it look as if all the colors have changed
10171017 MetavoxelData oldData = getAugmentedData();
10181018 oldData.touch(AttributeRegistry::getInstance()->getVoxelColorAttribute());
1019−
1019+
10201020 QThreadPool::globalInstance()->start(new Augmenter(_node, _data, oldData, _remoteDataLOD));
10211021 }
10221022
@@ -1029,9 +1029,9 @@ class SendDelayer : public QObject { · 6 unmodified lines
10291029 public:
10301030
10311031 SendDelayer(const SharedNodePointer& node, const QByteArray& data);
1032−
1032+
10331033 virtual void timerEvent(QTimerEvent* event);
1034−
1034+
10351035 private:
10361036
10371037 SharedNodePointer _node;
@@ -1039,8 +1039,8 @@ private: · 1 unmodified line
10391039 };
10401040
10411041 SendDelayer::SendDelayer(const SharedNodePointer& node, const QByteArray& data) :
1042−_node(node),
1043−_data(data.constData(), data.size()) {
1042+ _node(node),
1043+ _data(data.constData(), data.size()) {
10441044 }
10451045
10461046 void SendDelayer::timerEvent(QTimerEvent* event) {
@@ -1083,21 +1083,21 @@ void VoxelPoint::setNormal(const glm::vec3& normal) { · 36 unmodified lines
10831083 }
10841084
10851085 VoxelBuffer::VoxelBuffer(const QVector<VoxelPoint>& vertices, const QVector<int>& indices, const QVector<glm::vec3>& hermite,
1086− const QMultiHash<VoxelCoord, int>& quadIndices, int size, const QVector<SharedObjectPointer>& materials) :
1087−_vertices(vertices),
1088−_indices(indices),
1089−_hermite(hermite),
1090−_quadIndices(quadIndices),
1091−_size(size),
1092−_vertexCount(vertices.size()),
1093−_indexCount(indices.size()),
1094−_hermiteCount(hermite.size()),
1095−_indexBuffer(QOpenGLBuffer::IndexBuffer),
1096−_materials(materials) {
1086+ const QMultiHash<VoxelCoord, int>& quadIndices, int size, const QVector<SharedObjectPointer>& materials) :
1087+ _vertices(vertices),
1088+ _indices(indices),
1089+ _hermite(hermite),
1090+ _quadIndices(quadIndices),
1091+ _size(size),
1092+ _vertexCount(vertices.size()),
1093+ _indexCount(indices.size()),
1094+ _hermiteCount(hermite.size()),
1095+ _indexBuffer(QOpenGLBuffer::IndexBuffer),
1096+ _materials(materials) {
10971097 }
10981098
10991099 bool VoxelBuffer::findFirstRayIntersection(const glm::vec3& entry, const glm::vec3& origin,
1100− const glm::vec3& direction, float& distance) const {
1100+ const glm::vec3& direction, float& distance) const {
11011101 float highest = _size - 1.0f;
11021102 glm::vec3 position = entry * highest;
11031103 glm::vec3 floors = glm::floor(position);
@@ -1105,14 +1105,14 @@ bool VoxelBuffer::findFirstRayIntersection(const glm::vec3& entry, const glm::ve · 1 unmodified line
11051105 int x = qMin((int)floors.x, max), y = qMin((int)floors.y, max), z = qMin((int)floors.z, max);
11061106 forever {
11071107 for (QMultiHash<VoxelCoord, int>::const_iterator it = _quadIndices.constFind(qRgb(x + 1, y + 1, z + 1));
1108− it != _quadIndices.constEnd(); it++) {
1108+ it != _quadIndices.constEnd(); it++) {
11091109 const int* indices = _indices.constData() + *it;
11101110 if (findRayTriangleIntersection(origin, direction, _vertices.at(indices[0]).vertex,
1111− _vertices.at(indices[1]).vertex, _vertices.at(indices[2]).vertex, distance) ||
1111+ _vertices.at(indices[1]).vertex, _vertices.at(indices[2]).vertex, distance) ||
11121112 findRayTriangleIntersection(origin, direction, _vertices.at(indices[0]).vertex,
1113− _vertices.at(indices[2]).vertex, _vertices.at(indices[3]).vertex, distance)) {
1114− return true;
1115− }
1113+ _vertices.at(indices[2]).vertex, _vertices.at(indices[3]).vertex, distance)) {
1114+ return true;
1115+ }
11161116 }
11171117 float xDistance = FLT_MAX, yDistance = FLT_MAX, zDistance = FLT_MAX;
11181118 if (direction.x > 0.0f) {
@@ -1181,7 +1181,7 @@ void VoxelBuffer::render(bool cursor) { · 62 unmodified lines
11811181 const SharedObjectPointer material = _materials.at(i);
11821182 if (material) {
11831183 _networkTextures[i] = Application::getInstance()->getTextureCache()->getTexture(
1184− static_cast<MaterialObject*>(material.data())->getDiffuse(), SPLAT_TEXTURE);
1184+ static_cast<MaterialObject*>(material.data())->getDiffuse(), SPLAT_TEXTURE);
11851185 }
11861186 }
11871187 }
@@ -1216,7 +1216,7 @@ void VoxelBuffer::render(bool cursor) { · 28 unmodified lines
12161216 splatBatch.indexBuffer = &_indexBuffer;
12171217 splatBatch.vertexCount = _vertexCount;
12181218 splatBatch.indexCount = _indexCount;
1219−
1219+
12201220 for (int i = 0; i < _materials.size(); i += SPLAT_COUNT) {
12211221 for (int j = 0; j < SPLAT_COUNT; j++) {
12221222 int index = i + j;
@@ -1227,7 +1227,7 @@ void VoxelBuffer::render(bool cursor) { · 4 unmodified lines
12271227 splatBatch.splatTextureScalesS[j] = 1.0f / material->getScaleS();
12281228 splatBatch.splatTextureScalesT[j] = 1.0f / material->getScaleT();
12291229 splatBatch.splatTextureIDs[j] = texture->getID();
1230−
1230+
12311231 } else {
12321232 splatBatch.splatTextureIDs[j] = 0;
12331233 }
@@ -1256,7 +1256,7 @@ void VoxelBuffer::render(bool cursor) { · 22 unmodified lines
12561256 }
12571257
12581258 BufferDataAttribute::BufferDataAttribute(const QString& name) :
1259−InlineAttribute<BufferDataPointer>(name) {
1259+ InlineAttribute<BufferDataPointer>(name) {
12601260 }
12611261
12621262 bool BufferDataAttribute::merge(void*& parent, void* children[], bool postRead) const {
@@ -1278,17 +1278,17 @@ DefaultMetavoxelRendererImplementation::DefaultMetavoxelRendererImplementation() · 15 unmodified lines
12781278
12791279 class VoxelAugmentVisitor : public MetavoxelVisitor {
12801280 public:
1281−
1281+
12821282 VoxelAugmentVisitor(const MetavoxelLOD& lod);
12831283
12841284 virtual int visit(MetavoxelInfo& info);
12851285 };
12861286
12871287 VoxelAugmentVisitor::VoxelAugmentVisitor(const MetavoxelLOD& lod) :
1288−MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getVoxelColorAttribute() <<
1289− AttributeRegistry::getInstance()->getVoxelMaterialAttribute() <<
1290− AttributeRegistry::getInstance()->getVoxelHermiteAttribute(), QVector<AttributePointer>() <<
1291− Application::getInstance()->getMetavoxels()->getVoxelBufferAttribute(), lod) {
1288+ MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getVoxelColorAttribute() <<
1289+ AttributeRegistry::getInstance()->getVoxelMaterialAttribute() <<
1290+ AttributeRegistry::getInstance()->getVoxelHermiteAttribute(), QVector<AttributePointer>() <<
1291+ Application::getInstance()->getMetavoxels()->getVoxelBufferAttribute(), lod) {
12921292 }
12931293
12941294 class EdgeCrossing {
@@ -1446,9 +1446,9 @@ int VoxelAugmentVisitor::visit(MetavoxelInfo& info) { · 151 unmodified lines
14461446 // its properties (color, material, normal) if one is present; as before, boundary edges are excluded
14471447 int clampedX = qMax(x - 1, 0), clampedY = qMax(y - 1, 0), clampedZ = qMax(z - 1, 0);
14481448 const QRgb* hermiteBase = hermiteData + clampedZ * hermiteArea + clampedY * hermiteStride +
1449− clampedX * VoxelHermiteData::EDGE_COUNT;
1449+ clampedX * VoxelHermiteData::EDGE_COUNT;
14501450 const char* materialBase = materialData ?
1451− (materialData + clampedZ * area + clampedY * size + clampedX) : NULL;
1451+ (materialData + clampedZ * area + clampedY * size + clampedX) : NULL;
14521452 int crossingCount = 0;
14531453 if (middleX) {
14541454 if (alpha0 != alpha1) {
@@ -1650,7 +1650,7 @@ int VoxelAugmentVisitor::visit(MetavoxelInfo& info) { · 195 unmodified lines
16501650
16511651 if (displayHermite) {
16521652 glm::vec3 start = info.minimum + (glm::vec3(clampedX, clampedY, clampedZ) +
1653− crossing.point) * scale;
1653+ crossing.point) * scale;
16541654 hermiteSegments.append(start);
16551655 hermiteSegments.append(start + crossing.normal * scale);
16561656 }
@@ -1710,18 +1710,18 @@ int VoxelAugmentVisitor::visit(MetavoxelInfo& info) { · 53 unmodified lines
17101710 for (int i = 0; i < MAX_ITERATIONS; i++) {
17111711 glm::vec3 offDiagonals = glm::abs(glm::vec3(d[1][0], d[2][0], d[2][1]));
17121712 int largestIndex = (offDiagonals[0] > offDiagonals[1]) ? (offDiagonals[0] > offDiagonals[2] ? 0 : 2) :
1713− (offDiagonals[1] > offDiagonals[2] ? 1 : 2);
1713+ (offDiagonals[1] > offDiagonals[2] ? 1 : 2);
17141714 const float DESIRED_PRECISION = 0.00001f;
17151715 if (offDiagonals[largestIndex] < DESIRED_PRECISION) {
17161716 break;
17171717 }
17181718 int largestJ = (largestIndex == 2) ? 1 : 0;
1719− int largestI = (largestIndex == 0) ? 1 : 2;
1719+ int largestI = (largestIndex == 0) ? 1 : 2;
17201720 float sjj = d[largestJ][largestJ];
17211721 float sii = d[largestI][largestI];
17221722 float angle = glm::atan(2.0f * d[largestJ][largestI], sjj - sii) / 2.0f;
17231723 glm::quat rotation = glm::angleAxis(angle, largestIndex == 0 ? glm::vec3(0.0f, 0.0f, -1.0f) :
1724− (largestIndex == 1 ? glm::vec3(0.0f, 1.0f, 0.0f) : glm::vec3(-1.0f, 0.0f, 0.0f)));
1724+ (largestIndex == 1 ? glm::vec3(0.0f, 1.0f, 0.0f) : glm::vec3(-1.0f, 0.0f, 0.0f)));
17251725 combinedRotation = glm::normalize(rotation * combinedRotation);
17261726 glm::mat3 matrix = glm::mat3_cast(combinedRotation);
17271727 d = matrix * ata * glm::transpose(matrix);
@@ -1735,7 +1735,7 @@ int VoxelAugmentVisitor::visit(MetavoxelInfo& info) { · 7 unmodified lines
17351735
17361736 // compute the pseudo-inverse, ataplus, and use to find the minimizing solution
17371737 glm::mat3 u = glm::mat3_cast(combinedRotation);
1738− glm::mat3 ataplus = glm::transpose(u) * d * u;
1738+ glm::mat3 ataplus = glm::transpose(u) * d * u;
17391739 glm::vec3 solution = (ataplus * atrans * b) + center;
17401740
17411741 // make sure it doesn't fall beyond the cell boundaries
@@ -1774,7 +1774,7 @@ int VoxelAugmentVisitor::visit(MetavoxelInfo& info) { · 32 unmodified lines
17741774
17751775 const glm::vec3& first = vertices.at(index.indices[0]).vertex;
17761776 glm::vec3 normal = glm::cross(vertices.at(index1.indices[0]).vertex - first,
1777− vertices.at(index3.indices[0]).vertex - first);
1777+ vertices.at(index3.indices[0]).vertex - first);
17781778
17791779 if (alpha0 == 0) { // quad faces negative x
17801780 indices.append(index3.getClosestIndex(normal = -normal, vertices));
@@ -1800,7 +1800,7 @@ int VoxelAugmentVisitor::visit(MetavoxelInfo& info) { · 19 unmodified lines
18001800
18011801 const glm::vec3& first = vertices.at(index.indices[0]).vertex;
18021802 glm::vec3 normal = glm::cross(vertices.at(index3.indices[0]).vertex - first,
1803− vertices.at(index1.indices[0]).vertex - first);
1803+ vertices.at(index1.indices[0]).vertex - first);
18041804
18051805 if (alpha0 == 0) { // quad faces negative y
18061806 indices.append(index1.getClosestIndex(normal = -normal, vertices));
@@ -1826,7 +1826,7 @@ int VoxelAugmentVisitor::visit(MetavoxelInfo& info) { · 19 unmodified lines
18261826
18271827 const glm::vec3& first = vertices.at(index.indices[0]).vertex;
18281828 glm::vec3 normal = glm::cross(vertices.at(index1.indices[0]).vertex - first,
1829− vertices.at(index3.indices[0]).vertex - first);
1829+ vertices.at(index3.indices[0]).vertex - first);
18301830
18311831 if (alpha0 == 0) { // quad faces negative z
18321832 indices.append(index3.getClosestIndex(normal = -normal, vertices));
@@ -1861,7 +1861,7 @@ int VoxelAugmentVisitor::visit(MetavoxelInfo& info) { · 28 unmodified lines
18611861 }
18621862 }
18631863 buffer = new VoxelBuffer(vertices, indices, hermiteSegments, quadIndices, size,
1864− material ? material->getMaterials() : QVector<SharedObjectPointer>());
1864+ material ? material->getMaterials() : QVector<SharedObjectPointer>());
18651865 }
18661866 BufferDataPointer pointer(buffer);
18671867 info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(pointer));
@@ -1869,14 +1869,14 @@ int VoxelAugmentVisitor::visit(MetavoxelInfo& info) { · 1 unmodified line
18691869 }
18701870
18711871 void DefaultMetavoxelRendererImplementation::augment(MetavoxelData& data, const MetavoxelData& previous,
1872− MetavoxelInfo& info, const MetavoxelLOD& lod) {
1872+ MetavoxelInfo& info, const MetavoxelLOD& lod) {
18731873 // copy the previous buffers
18741874 MetavoxelData expandedPrevious = previous;
18751875 while (expandedPrevious.getSize() < data.getSize()) {
18761876 expandedPrevious.expand();
18771877 }
18781878 const AttributePointer& voxelBufferAttribute =
1879− Application::getInstance()->getMetavoxels()->getVoxelBufferAttribute();
1879+ Application::getInstance()->getMetavoxels()->getVoxelBufferAttribute();
18801880 MetavoxelNode* root = expandedPrevious.getRoot(voxelBufferAttribute);
18811881 if (root) {
18821882 data.setRoot(voxelBufferAttribute, root);
@@ -1892,16 +1892,16 @@ public: · 9 unmodified lines
18921892 SpannerSimulateVisitor(float deltaTime, const MetavoxelLOD& lod);
18931893
18941894 virtual bool visit(Spanner* spanner);
1895−
1895+
18961896 private:
18971897
18981898 float _deltaTime;
18991899 };
19001900
19011901 SpannerSimulateVisitor::SpannerSimulateVisitor(float deltaTime, const MetavoxelLOD& lod) :
1902−SpannerVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getSpannersAttribute(),
1903− QVector<AttributePointer>(), QVector<AttributePointer>(), lod),
1904−_deltaTime(deltaTime) {
1902+ SpannerVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getSpannersAttribute(),
1903+ QVector<AttributePointer>(), QVector<AttributePointer>(), lod),
1904+ _deltaTime(deltaTime) {
19051905 }
19061906
19071907 bool SpannerSimulateVisitor::visit(Spanner* spanner) {
@@ -1910,7 +1910,7 @@ bool SpannerSimulateVisitor::visit(Spanner* spanner) { · 2 unmodified lines
19101910 }
19111911
19121912 void DefaultMetavoxelRendererImplementation::simulate(MetavoxelData& data, float deltaTime,
1913− MetavoxelInfo& info, const MetavoxelLOD& lod) {
1913+ MetavoxelInfo& info, const MetavoxelLOD& lod) {
19141914 SpannerSimulateVisitor spannerSimulateVisitor(deltaTime, lod);
19151915 data.guide(spannerSimulateVisitor);
19161916 }
@@ -1921,7 +1921,7 @@ public: · 4 unmodified lines
19211921 BufferRenderVisitor(const AttributePointer& attribute);
19221922
19231923 virtual int visit(MetavoxelInfo& info);
1924−
1924+
19251925 private:
19261926
19271927 int _order;
@@ -1929,15 +1929,15 @@ private: · 1 unmodified line
19291929 };
19301930
19311931 BufferRenderVisitor::BufferRenderVisitor(const AttributePointer& attribute) :
1932−MetavoxelVisitor(QVector<AttributePointer>() << attribute),
1933−_order(encodeOrder(Application::getInstance()->getDisplayViewFrustum()->getDirection())),
1934−_containmentDepth(INT_MAX) {
1932+ MetavoxelVisitor(QVector<AttributePointer>() << attribute),
1933+ _order(encodeOrder(Application::getInstance()->getDisplayViewFrustum()->getDirection())),
1934+ _containmentDepth(INT_MAX) {
19351935 }
19361936
19371937 int BufferRenderVisitor::visit(MetavoxelInfo& info) {
19381938 if (_containmentDepth >= _depth) {
19391939 Frustum::IntersectionType intersection = Application::getInstance()->getMetavoxels()->getFrustum().getIntersectionType(
1940− info.getBounds());
1940+ info.getBounds());
19411941 if (intersection == Frustum::NO_INTERSECTION) {
19421942 return STOP_RECURSION;
19431943 }
@@ -2007,12 +2007,12 @@ void CuboidRenderer::render(const MetavoxelLOD& lod, bool contained, bool cursor · 63 unmodified lines
20072007 }
20082008
20092009 StaticModelRenderer::StaticModelRenderer() :
2010−_model(new Model(this)) {
2010+ _model(new Model(this)) {
20112011 }
20122012
20132013 void StaticModelRenderer::init(Spanner* spanner) {
20142014 SpannerRenderer::init(spanner);
2015−
2015+
20162016 _model->init();
20172017
20182018 StaticModel* staticModel = static_cast<StaticModel*>(spanner);
@@ -2035,7 +2035,7 @@ void StaticModelRenderer::simulate(float deltaTime) { · 16 unmodified lines
20352035 bounds = Box(extents.minimum, extents.maximum);
20362036 }
20372037 static_cast<StaticModel*>(_spanner)->setBounds(glm::translate(_model->getTranslation()) *
2038− glm::mat4_cast(_model->getRotation()) * glm::scale(_model->getScale()) * bounds);
2038+ glm::mat4_cast(_model->getRotation()) * glm::scale(_model->getScale()) * bounds);
20392039 _model->simulate(deltaTime);
20402040 }
20412041
@@ -2251,7 +2251,7 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g · 209 unmodified lines
22512251 if (cursor) {
22522252 bufferPair.first.bind();
22532253 bufferPair.second.bind();
2254−
2254+
22552255 glPushMatrix();
22562256 glTranslatef(translation.x, translation.y, translation.z);
22572257 glm::vec3 axis = glm::axis(rotation);
@@ -2286,7 +2286,7 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g · 28 unmodified lines
22862286 baseBatch.heightScale = glm::vec4(1.0f / width, 1.0f / height, (innerWidth - 1) / -2.0f, (innerHeight - 1) / -2.0f);
22872287 baseBatch.colorTextureID = _colorTextureID;
22882288 baseBatch.colorScale = glm::vec2((float)width / innerWidth, (float)height / innerHeight);
2289− Application::getInstance()->getMetavoxels()->addHeightfieldBaseBatch(baseBatch);
2289+ Application::getInstance()->getMetavoxels()->addHeightfieldBaseBatch(baseBatch);
22902290
22912291 if (!_networkTextures.isEmpty()) {
22922292 HeightfieldSplatBatch splatBatch;
@@ -2331,3 +2331,4 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g · 38 unmodified lines
23312331 }
23322332
23332333 QHash<HeightfieldNodeRenderer::IntPair, HeightfieldNodeRenderer::BufferPair> HeightfieldNodeRenderer::_bufferPairs;
2334+

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t