mirror of
https://github.com/overte-org/overte.git
synced 2025-07-10 20:38:37 +02:00
Fix for successive heightfield placements.
This commit is contained in:
parent
b4b1559e32
commit
a022b7fa17
3 changed files with 9 additions and 1 deletions
|
@ -789,7 +789,7 @@ void ImportHeightfieldTool::apply() {
|
||||||
if (!(_height->getHeight() && attribute)) {
|
if (!(_height->getHeight() && attribute)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MetavoxelEditMessage message = { QVariant::fromValue(InsertSpannerEdit(attribute, _spanner)) };
|
MetavoxelEditMessage message = { QVariant::fromValue(InsertSpannerEdit(attribute, _spanner->clone())) };
|
||||||
Application::getInstance()->getMetavoxels()->applyEdit(message, true);
|
Application::getInstance()->getMetavoxels()->applyEdit(message, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2063,6 +2063,12 @@ MetavoxelLOD Heightfield::transformLOD(const MetavoxelLOD& lod) const {
|
||||||
qMax(0.5f, glm::abs(position.y * _aspectY - 0.5f)) * THRESHOLD_MULTIPLIER);
|
qMax(0.5f, glm::abs(position.y * _aspectY - 0.5f)) * THRESHOLD_MULTIPLIER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SharedObject* Heightfield::clone(bool withID, SharedObject* target) const {
|
||||||
|
Heightfield* newHeightfield = static_cast<Heightfield*>(Spanner::clone(withID, target));
|
||||||
|
newHeightfield->setRoot(_root);
|
||||||
|
return newHeightfield;
|
||||||
|
}
|
||||||
|
|
||||||
bool Heightfield::isHeightfield() const {
|
bool Heightfield::isHeightfield() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -579,6 +579,8 @@ public:
|
||||||
|
|
||||||
MetavoxelLOD transformLOD(const MetavoxelLOD& lod) const;
|
MetavoxelLOD transformLOD(const MetavoxelLOD& lod) const;
|
||||||
|
|
||||||
|
virtual SharedObject* clone(bool withID = false, SharedObject* target = NULL) const;
|
||||||
|
|
||||||
virtual bool isHeightfield() const;
|
virtual bool isHeightfield() const;
|
||||||
|
|
||||||
virtual float getHeight(const glm::vec3& location) const;
|
virtual float getHeight(const glm::vec3& location) const;
|
||||||
|
|
Loading…
Reference in a new issue