VOXELFORMAT: allow to get the region size of the group

master
Martin Gerhardy 2022-03-27 11:53:33 +02:00
parent 8cee98a8cb
commit 7dd6994b03
2 changed files with 14 additions and 0 deletions

View File

@ -93,6 +93,19 @@ const SceneGraphNode& SceneGraph::root() const {
return node(0);
}
voxel::Region SceneGraph::groupRegion() const {
int nodeId = activeNode();
voxel::Region region = node(nodeId).region();
if (node(nodeId).locked()) {
for (iterator iter = begin(SceneGraphNodeType::Model); iter != end(); ++iter) {
if ((*iter).locked()) {
region.accumulate((*iter).region());
}
}
}
return region;
}
voxel::Region SceneGraph::region() const {
voxel::Region r;
bool validVolume = false;

View File

@ -42,6 +42,7 @@ public:
* @return The full region of the whole scene
*/
voxel::Region region() const;
voxel::Region groupRegion() const;
const core::DynamicArray<core::String> animations();
void addAnimation(const core::String& animation);