Pass in the starting minimum/size.

This commit is contained in:
Andrzej Kapolka 2014-01-29 11:14:10 -08:00
parent 2f23d918f6
commit 154deccbc6
2 changed files with 5 additions and 4 deletions

View file

@ -29,13 +29,12 @@ MetavoxelData& MetavoxelData::operator=(const MetavoxelData& other) {
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)
const float TOP_LEVEL_SIZE = 1.0f;
const QVector<AttributePointer>& inputs = visitor.getInputs();
const QVector<AttributePointer>& outputs = visitor.getOutputs();
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()) } };
for (int i = 0; i < inputs.size(); i++) {
MetavoxelNode* node = _roots.value(inputs.at(i));

View file

@ -37,7 +37,9 @@ public:
MetavoxelData& operator=(const MetavoxelData& other);
/// 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 write(Bitstream& out) const;