mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 09:18:45 +02:00
Fix for toggling Hermite display.
This commit is contained in:
parent
c78d38b925
commit
10fdb01436
2 changed files with 8 additions and 3 deletions
|
@ -579,7 +579,8 @@ bool MetavoxelSystem::findFirstRayVoxelIntersection(const glm::vec3& origin, con
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetavoxelSystem::paintHeightfieldColor(const glm::vec3& position, float radius, const QColor& color) {
|
void MetavoxelSystem::paintHeightfieldColor(const glm::vec3& position, float radius, const QColor& color) {
|
||||||
MetavoxelEditMessage edit = { QVariant::fromValue(PaintHeightfieldMaterialEdit(position, radius, SharedObjectPointer(), color)) };
|
MetavoxelEditMessage edit = { QVariant::fromValue(PaintHeightfieldMaterialEdit(position, radius,
|
||||||
|
SharedObjectPointer(), color)) };
|
||||||
applyEdit(edit, true);
|
applyEdit(edit, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1106,6 +1107,7 @@ VoxelBuffer::VoxelBuffer(const QVector<VoxelPoint>& vertices, const QVector<int>
|
||||||
_vertices(vertices),
|
_vertices(vertices),
|
||||||
_indices(indices),
|
_indices(indices),
|
||||||
_hermite(hermite),
|
_hermite(hermite),
|
||||||
|
_hermiteEnabled(Menu::getInstance()->isOptionChecked(MenuOption::DisplayHermiteData)),
|
||||||
_quadIndices(quadIndices),
|
_quadIndices(quadIndices),
|
||||||
_size(size),
|
_size(size),
|
||||||
_vertexCount(vertices.size()),
|
_vertexCount(vertices.size()),
|
||||||
|
@ -2292,7 +2294,8 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g
|
||||||
// restore the default alignment; it's what Qt uses for image storage
|
// restore the default alignment; it's what Qt uses for image storage
|
||||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||||
}
|
}
|
||||||
if (!_voxels && node->getStack()) {
|
bool displayHermite = Menu::getInstance()->isOptionChecked(MenuOption::DisplayHermiteData);
|
||||||
|
if ((!_voxels || (displayHermite && !static_cast<VoxelBuffer*>(_voxels.data())->isHermiteEnabled())) && node->getStack()) {
|
||||||
QVector<VoxelPoint> vertices;
|
QVector<VoxelPoint> vertices;
|
||||||
QVector<int> indices;
|
QVector<int> indices;
|
||||||
QVector<glm::vec3> hermiteSegments;
|
QVector<glm::vec3> hermiteSegments;
|
||||||
|
@ -2306,7 +2309,6 @@ void HeightfieldNodeRenderer::render(const HeightfieldNodePointer& node, const g
|
||||||
glm::vec3 pos;
|
glm::vec3 pos;
|
||||||
glm::vec3 step(1.0f / innerStackWidth, scale.x / (innerStackWidth * scale.y),
|
glm::vec3 step(1.0f / innerStackWidth, scale.x / (innerStackWidth * scale.y),
|
||||||
1.0f / innerStackHeight);
|
1.0f / innerStackHeight);
|
||||||
bool displayHermite = Menu::getInstance()->isOptionChecked(MenuOption::DisplayHermiteData);
|
|
||||||
|
|
||||||
for (int z = 0; z < stackHeight; z++, pos.z += step.z) {
|
for (int z = 0; z < stackHeight; z++, pos.z += step.z) {
|
||||||
pos.x = 0.0f;
|
pos.x = 0.0f;
|
||||||
|
|
|
@ -331,6 +331,8 @@ public:
|
||||||
const QMultiHash<VoxelCoord, int>& quadIndices, int size, const QVector<SharedObjectPointer>& materials =
|
const QMultiHash<VoxelCoord, int>& quadIndices, int size, const QVector<SharedObjectPointer>& materials =
|
||||||
QVector<SharedObjectPointer>());
|
QVector<SharedObjectPointer>());
|
||||||
|
|
||||||
|
bool isHermiteEnabled() const { return _hermiteEnabled; }
|
||||||
|
|
||||||
/// Finds the first intersection between the described ray and the voxel data.
|
/// Finds the first intersection between the described ray and the voxel data.
|
||||||
/// \param entry the entry point of the ray in relative coordinates, from (0, 0, 0) to (1, 1, 1)
|
/// \param entry the entry point of the ray in relative coordinates, from (0, 0, 0) to (1, 1, 1)
|
||||||
bool findFirstRayIntersection(const glm::vec3& entry, const glm::vec3& origin,
|
bool findFirstRayIntersection(const glm::vec3& entry, const glm::vec3& origin,
|
||||||
|
@ -344,6 +346,7 @@ private:
|
||||||
QVector<VoxelPoint> _vertices;
|
QVector<VoxelPoint> _vertices;
|
||||||
QVector<int> _indices;
|
QVector<int> _indices;
|
||||||
QVector<glm::vec3> _hermite;
|
QVector<glm::vec3> _hermite;
|
||||||
|
bool _hermiteEnabled;
|
||||||
QMultiHash<VoxelCoord, int> _quadIndices;
|
QMultiHash<VoxelCoord, int> _quadIndices;
|
||||||
int _size;
|
int _size;
|
||||||
int _vertexCount;
|
int _vertexCount;
|
||||||
|
|
Loading…
Reference in a new issue