mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 21:36:12 +02:00
Pass in the starting minimum/size.
This commit is contained in:
parent
2f23d918f6
commit
154deccbc6
2 changed files with 5 additions and 4 deletions
|
@ -29,13 +29,12 @@ MetavoxelData& MetavoxelData::operator=(const MetavoxelData& other) {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetavoxelData::guide(MetavoxelVisitor& visitor) {
|
void MetavoxelData::guide(MetavoxelVisitor& visitor, const glm::vec3& minimum, float size) {
|
||||||
// start with the root values/defaults (plus the guide attribute)
|
// start with the root values/defaults (plus the guide attribute)
|
||||||
const float TOP_LEVEL_SIZE = 1.0f;
|
|
||||||
const QVector<AttributePointer>& inputs = visitor.getInputs();
|
const QVector<AttributePointer>& inputs = visitor.getInputs();
|
||||||
const QVector<AttributePointer>& outputs = visitor.getOutputs();
|
const QVector<AttributePointer>& outputs = visitor.getOutputs();
|
||||||
MetavoxelVisitation firstVisitation = { NULL, visitor, QVector<MetavoxelNode*>(inputs.size() + 1),
|
MetavoxelVisitation firstVisitation = { NULL, visitor, QVector<MetavoxelNode*>(inputs.size() + 1),
|
||||||
QVector<MetavoxelNode*>(outputs.size()), { glm::vec3(), TOP_LEVEL_SIZE,
|
QVector<MetavoxelNode*>(outputs.size()), { minimum, size,
|
||||||
QVector<AttributeValue>(inputs.size() + 1), QVector<AttributeValue>(outputs.size()) } };
|
QVector<AttributeValue>(inputs.size() + 1), QVector<AttributeValue>(outputs.size()) } };
|
||||||
for (int i = 0; i < inputs.size(); i++) {
|
for (int i = 0; i < inputs.size(); i++) {
|
||||||
MetavoxelNode* node = _roots.value(inputs.at(i));
|
MetavoxelNode* node = _roots.value(inputs.at(i));
|
||||||
|
|
|
@ -37,7 +37,9 @@ public:
|
||||||
MetavoxelData& operator=(const MetavoxelData& other);
|
MetavoxelData& operator=(const MetavoxelData& other);
|
||||||
|
|
||||||
/// Applies the specified visitor to the contained voxels.
|
/// Applies the specified visitor to the contained voxels.
|
||||||
void guide(MetavoxelVisitor& visitor);
|
/// \param minimum the top-level minimum
|
||||||
|
/// \param size the top-level size
|
||||||
|
void guide(MetavoxelVisitor& visitor, const glm::vec3& minimum = glm::vec3(), float size = 1.0f);
|
||||||
|
|
||||||
void read(Bitstream& in);
|
void read(Bitstream& in);
|
||||||
void write(Bitstream& out) const;
|
void write(Bitstream& out) const;
|
||||||
|
|
Loading…
Reference in a new issue