本文整理汇总了C++中NodeRef::alignedNode方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeRef::alignedNode方法的具体用法?C++ NodeRef::alignedNode怎么用?C++ NodeRef::alignedNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeRef
的用法示例。
在下文中一共展示了NodeRef::alignedNode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
typename BVHN<N>::NodeRef BVHN<N>::layoutLargeNodesRecursion(NodeRef& node, FastAllocator::ThreadLocal& allocator)
{
if (node.isBarrier()) {
node.clearBarrier();
return node;
}
else if (node.isAlignedNode())
{
AlignedNode* oldnode = node.alignedNode();
AlignedNode* newnode = (BVHN::AlignedNode*) allocator.malloc(sizeof(BVHN::AlignedNode),byteNodeAlignment);
*newnode = *oldnode;
for (size_t c=0; c<N; c++)
newnode->child(c) = layoutLargeNodesRecursion(oldnode->child(c),allocator);
return encodeNode(newnode);
}
else return node;
}
示例2: assert
BBox3fa BVHNRefitter<N>::refit_toplevel(NodeRef& ref,
size_t &subtrees,
const BBox3fa *const subTreeBounds,
const size_t depth)
{
if (depth >= MAX_SUB_TREE_EXTRACTION_DEPTH)
{
assert(subtrees < MAX_NUM_SUB_TREES);
assert(subTrees[subtrees] == ref);
return subTreeBounds[subtrees++];
}
if (ref.isAlignedNode())
{
AlignedNode* node = ref.alignedNode();
BBox3fa bounds[N];
for (size_t i=0; i<N; i++)
{
NodeRef& child = node->child(i);
if (unlikely(child == BVH::emptyNode))
bounds[i] = BBox3fa(empty);
else
bounds[i] = refit_toplevel(child,subtrees,subTreeBounds,depth+1);
}
BBox3vf<N> boundsT = transpose<N>(bounds);
/* set new bounds */
node->lower_x = boundsT.lower.x;
node->lower_y = boundsT.lower.y;
node->lower_z = boundsT.lower.z;
node->upper_x = boundsT.upper.x;
node->upper_y = boundsT.upper.y;
node->upper_z = boundsT.upper.z;
return merge<N>(bounds);
}
else
return leafBounds.leafBounds(ref);
}
示例3: defined
BBox3fa BVHNRefitter<N>::recurse_bottom(NodeRef& ref)
{
/* this is a leaf node */
if (unlikely(ref.isLeaf()))
return leafBounds.leafBounds(ref);
/* recurse if this is an internal node */
AlignedNode* node = ref.alignedNode();
/* enable exclusive prefetch for >= AVX platforms */
#if defined(__AVX__)
ref.prefetchW();
#endif
BBox3fa bounds[N];
for (size_t i=0; i<N; i++)
if (unlikely(node->child(i) == BVH::emptyNode))
{
bounds[i] = BBox3fa(empty);
}
else
bounds[i] = recurse_bottom(node->child(i));
/* AOS to SOA transform */
BBox3vf<N> boundsT = transpose<N>(bounds);
/* set new bounds */
node->lower_x = boundsT.lower.x;
node->lower_y = boundsT.lower.y;
node->lower_z = boundsT.lower.z;
node->upper_x = boundsT.upper.x;
node->upper_y = boundsT.upper.y;
node->upper_z = boundsT.upper.z;
return merge<N>(bounds);
}