mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:29:03 +02:00
repairs to MetavoxelSystem after reset to upstream
This commit is contained in:
parent
c18c45a401
commit
fa8b7020b0
1 changed files with 175 additions and 174 deletions
|
@ -41,11 +41,11 @@ REGISTER_META_OBJECT(HeightfieldRenderer)
|
|||
|
||||
MetavoxelSystem::NetworkSimulation::NetworkSimulation(float dropRate, float repeatRate,
|
||||
int minimumDelay, int maximumDelay, int bandwidthLimit) :
|
||||
dropRate(dropRate),
|
||||
repeatRate(repeatRate),
|
||||
minimumDelay(minimumDelay),
|
||||
maximumDelay(maximumDelay),
|
||||
bandwidthLimit(bandwidthLimit) {
|
||||
dropRate(dropRate),
|
||||
repeatRate(repeatRate),
|
||||
minimumDelay(minimumDelay),
|
||||
maximumDelay(maximumDelay),
|
||||
bandwidthLimit(bandwidthLimit) {
|
||||
}
|
||||
|
||||
MetavoxelSystem::~MetavoxelSystem() {
|
||||
|
@ -131,9 +131,9 @@ private:
|
|||
};
|
||||
|
||||
SimulateVisitor::SimulateVisitor(float deltaTime, const MetavoxelLOD& lod) :
|
||||
MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(),
|
||||
MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(),
|
||||
QVector<AttributePointer>(), lod),
|
||||
_deltaTime(deltaTime) {
|
||||
_deltaTime(deltaTime) {
|
||||
}
|
||||
|
||||
int SimulateVisitor::visit(MetavoxelInfo& info) {
|
||||
|
@ -166,7 +166,7 @@ public:
|
|||
};
|
||||
|
||||
RenderVisitor::RenderVisitor(const MetavoxelLOD& lod) :
|
||||
MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(),
|
||||
MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(),
|
||||
QVector<AttributePointer>(), lod) {
|
||||
}
|
||||
|
||||
|
@ -518,9 +518,9 @@ public:
|
|||
|
||||
RayVoxelIntersectionVisitor::RayVoxelIntersectionVisitor(const glm::vec3& origin,
|
||||
const glm::vec3& direction, const MetavoxelLOD& lod) :
|
||||
RayIntersectionVisitor(origin, direction, QVector<AttributePointer>() <<
|
||||
RayIntersectionVisitor(origin, direction, QVector<AttributePointer>() <<
|
||||
Application::getInstance()->getMetavoxels()->getVoxelBufferAttribute(), QVector<AttributePointer>(), lod),
|
||||
intersectionDistance(FLT_MAX) {
|
||||
intersectionDistance(FLT_MAX) {
|
||||
}
|
||||
|
||||
int RayVoxelIntersectionVisitor::visit(MetavoxelInfo& info, float distance) {
|
||||
|
@ -702,8 +702,8 @@ private:
|
|||
};
|
||||
|
||||
BufferCursorRenderVisitor::BufferCursorRenderVisitor(const AttributePointer& attribute, const Box& bounds) :
|
||||
MetavoxelVisitor(QVector<AttributePointer>() << attribute),
|
||||
_bounds(bounds) {
|
||||
MetavoxelVisitor(QVector<AttributePointer>() << attribute),
|
||||
_bounds(bounds) {
|
||||
}
|
||||
|
||||
int BufferCursorRenderVisitor::visit(MetavoxelInfo& info) {
|
||||
|
@ -778,8 +778,8 @@ protected:
|
|||
};
|
||||
|
||||
MaterialEditApplier::MaterialEditApplier(const MetavoxelEditMessage& message, const QSharedPointer<NetworkTexture> texture) :
|
||||
_message(message),
|
||||
_texture(texture) {
|
||||
_message(message),
|
||||
_texture(texture) {
|
||||
}
|
||||
|
||||
void MaterialEditApplier::handle() {
|
||||
|
@ -818,7 +818,7 @@ MetavoxelClient* MetavoxelSystem::createClient(const SharedNodePointer& node) {
|
|||
}
|
||||
|
||||
void MetavoxelSystem::guideToAugmented(MetavoxelVisitor& visitor, bool render) {
|
||||
NodeList::getInstance()->eachNode([&visitor, &render](const SharedNodePointer& node) {
|
||||
NodeList::getInstance()->eachNode([&visitor, &render](const SharedNodePointer& node){
|
||||
if (node->getType() == NodeType::MetavoxelServer) {
|
||||
QMutexLocker locker(&node->getMutex());
|
||||
MetavoxelSystemClient* client = static_cast<MetavoxelSystemClient*>(node->getLinkedData());
|
||||
|
@ -859,8 +859,8 @@ void MetavoxelSystem::loadSplatProgram(const char* type, ProgramObject& program,
|
|||
}
|
||||
|
||||
Throttle::Throttle() :
|
||||
_limit(INT_MAX),
|
||||
_total(0) {
|
||||
_limit(INT_MAX),
|
||||
_total(0) {
|
||||
}
|
||||
|
||||
bool Throttle::shouldThrottle(int bytes) {
|
||||
|
@ -881,7 +881,7 @@ bool Throttle::shouldThrottle(int bytes) {
|
|||
}
|
||||
|
||||
MetavoxelSystemClient::MetavoxelSystemClient(const SharedNodePointer& node, MetavoxelUpdater* updater) :
|
||||
MetavoxelClient(node, updater) {
|
||||
MetavoxelClient(node, updater) {
|
||||
}
|
||||
|
||||
void MetavoxelSystemClient::setAugmentedData(const MetavoxelData& data) {
|
||||
|
@ -910,8 +910,8 @@ private:
|
|||
};
|
||||
|
||||
ReceiveDelayer::ReceiveDelayer(const SharedNodePointer& node, const QByteArray& packet) :
|
||||
_node(node),
|
||||
_packet(packet) {
|
||||
_node(node),
|
||||
_packet(packet) {
|
||||
}
|
||||
|
||||
void ReceiveDelayer::timerEvent(QTimerEvent* event) {
|
||||
|
@ -963,9 +963,9 @@ private:
|
|||
};
|
||||
|
||||
AugmentVisitor::AugmentVisitor(const MetavoxelLOD& lod, const MetavoxelData& previousData) :
|
||||
MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(),
|
||||
MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(),
|
||||
QVector<AttributePointer>(), lod),
|
||||
_previousData(previousData) {
|
||||
_previousData(previousData) {
|
||||
}
|
||||
|
||||
int AugmentVisitor::visit(MetavoxelInfo& info) {
|
||||
|
@ -995,10 +995,10 @@ private:
|
|||
|
||||
Augmenter::Augmenter(const SharedNodePointer& node, const MetavoxelData& data,
|
||||
const MetavoxelData& previousData, const MetavoxelLOD& lod) :
|
||||
_node(node),
|
||||
_data(data),
|
||||
_previousData(previousData),
|
||||
_lod(lod) {
|
||||
_node(node),
|
||||
_data(data),
|
||||
_previousData(previousData),
|
||||
_lod(lod) {
|
||||
}
|
||||
|
||||
void Augmenter::run() {
|
||||
|
@ -1039,8 +1039,8 @@ private:
|
|||
};
|
||||
|
||||
SendDelayer::SendDelayer(const SharedNodePointer& node, const QByteArray& data) :
|
||||
_node(node),
|
||||
_data(data.constData(), data.size()) {
|
||||
_node(node),
|
||||
_data(data.constData(), data.size()) {
|
||||
}
|
||||
|
||||
void SendDelayer::timerEvent(QTimerEvent* event) {
|
||||
|
@ -1084,16 +1084,16 @@ void VoxelPoint::setNormal(const glm::vec3& normal) {
|
|||
|
||||
VoxelBuffer::VoxelBuffer(const QVector<VoxelPoint>& vertices, const QVector<int>& indices, const QVector<glm::vec3>& hermite,
|
||||
const QMultiHash<VoxelCoord, int>& quadIndices, int size, const QVector<SharedObjectPointer>& materials) :
|
||||
_vertices(vertices),
|
||||
_indices(indices),
|
||||
_hermite(hermite),
|
||||
_quadIndices(quadIndices),
|
||||
_size(size),
|
||||
_vertexCount(vertices.size()),
|
||||
_indexCount(indices.size()),
|
||||
_hermiteCount(hermite.size()),
|
||||
_indexBuffer(QOpenGLBuffer::IndexBuffer),
|
||||
_materials(materials) {
|
||||
_vertices(vertices),
|
||||
_indices(indices),
|
||||
_hermite(hermite),
|
||||
_quadIndices(quadIndices),
|
||||
_size(size),
|
||||
_vertexCount(vertices.size()),
|
||||
_indexCount(indices.size()),
|
||||
_hermiteCount(hermite.size()),
|
||||
_indexBuffer(QOpenGLBuffer::IndexBuffer),
|
||||
_materials(materials) {
|
||||
}
|
||||
|
||||
bool VoxelBuffer::findFirstRayIntersection(const glm::vec3& entry, const glm::vec3& origin,
|
||||
|
@ -1256,7 +1256,7 @@ void VoxelBuffer::render(bool cursor) {
|
|||
}
|
||||
|
||||
BufferDataAttribute::BufferDataAttribute(const QString& name) :
|
||||
InlineAttribute<BufferDataPointer>(name) {
|
||||
InlineAttribute<BufferDataPointer>(name) {
|
||||
}
|
||||
|
||||
bool BufferDataAttribute::merge(void*& parent, void* children[], bool postRead) const {
|
||||
|
@ -1285,7 +1285,7 @@ public:
|
|||
};
|
||||
|
||||
VoxelAugmentVisitor::VoxelAugmentVisitor(const MetavoxelLOD& lod) :
|
||||
MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getVoxelColorAttribute() <<
|
||||
MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getVoxelColorAttribute() <<
|
||||
AttributeRegistry::getInstance()->getVoxelMaterialAttribute() <<
|
||||
AttributeRegistry::getInstance()->getVoxelHermiteAttribute(), QVector<AttributePointer>() <<
|
||||
Application::getInstance()->getMetavoxels()->getVoxelBufferAttribute(), lod) {
|
||||
|
@ -1899,9 +1899,9 @@ private:
|
|||
};
|
||||
|
||||
SpannerSimulateVisitor::SpannerSimulateVisitor(float deltaTime, const MetavoxelLOD& lod) :
|
||||
SpannerVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getSpannersAttribute(),
|
||||
SpannerVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getSpannersAttribute(),
|
||||
QVector<AttributePointer>(), QVector<AttributePointer>(), lod),
|
||||
_deltaTime(deltaTime) {
|
||||
_deltaTime(deltaTime) {
|
||||
}
|
||||
|
||||
bool SpannerSimulateVisitor::visit(Spanner* spanner) {
|
||||
|
@ -1929,9 +1929,9 @@ private:
|
|||
};
|
||||
|
||||
BufferRenderVisitor::BufferRenderVisitor(const AttributePointer& attribute) :
|
||||
MetavoxelVisitor(QVector<AttributePointer>() << attribute),
|
||||
_order(encodeOrder(Application::getInstance()->getDisplayViewFrustum()->getDirection())),
|
||||
_containmentDepth(INT_MAX) {
|
||||
MetavoxelVisitor(QVector<AttributePointer>() << attribute),
|
||||
_order(encodeOrder(Application::getInstance()->getDisplayViewFrustum()->getDirection())),
|
||||
_containmentDepth(INT_MAX) {
|
||||
}
|
||||
|
||||
int BufferRenderVisitor::visit(MetavoxelInfo& info) {
|
||||
|
@ -2007,7 +2007,7 @@ void CuboidRenderer::render(const MetavoxelLOD& lod, bool contained, bool cursor
|
|||
}
|
||||
|
||||
StaticModelRenderer::StaticModelRenderer() :
|
||||
_model(new Model(this)) {
|
||||
_model(new Model(this)) {
|
||||
}
|
||||
|
||||
void StaticModelRenderer::init(Spanner* spanner) {
|
||||
|
@ -2331,3 +2331,4 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g
|
|||
}
|
||||
|
||||
QHash<HeightfieldNodeRenderer::IntPair, HeightfieldNodeRenderer::BufferPair> HeightfieldNodeRenderer::_bufferPairs;
|
||||
|
||||
|
|
Loading…
Reference in a new issue