commit e5218c470d110658cc89de569d9a558c2a4d8b4d
parent a1f763b628c6b4439f8f539b50d75f1c155a3248
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 2 Mar 2018 12:25:44 +0100
Fix the `at' accessor when a filter function is used
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/htvox_octree.c b/src/htvox_octree.c
@@ -730,6 +730,7 @@ htvox_octree_at
struct htvox_voxel* voxel)
{
struct octree_index inode;
+ struct octree_index iattr;
struct htvox_voxel vox = HTVOX_VOXEL_NULL;
double scale_exp2;
double low[3];
@@ -797,12 +798,11 @@ htvox_octree_at
vox.is_leaf = (node->is_leaf & ichild_flag) != 0;
if(filter || vox.is_leaf) {
- inode = octree_buffer_get_child_attr_index(&oct->buffer, inode, ichild);
- vox.data = octree_buffer_get_attr(&oct->buffer, inode);
- vox.id = absolute_attr_index(&oct->buffer, inode);
+ iattr = octree_buffer_get_child_attr_index(&oct->buffer, inode, ichild);
+ vox.data = octree_buffer_get_attr(&oct->buffer, iattr);
+ vox.id = absolute_attr_index(&oct->buffer, iattr);
vox.is_leaf = (node->is_leaf & ichild_flag) != 0;
if(vox.is_leaf || !filter(&vox, position, context)) {
- ++vox.depth;
*voxel = vox;
break;
}