Blender V2.61 - r43446
|
#include <bvh.h>
Public Member Functions | |
virtual | ~BVH () |
void | build (Progress &progress) |
void | refit (Progress &progress) |
void | clear_cache_except () |
Static Public Member Functions | |
static BVH * | create (const BVHParams ¶ms, const vector< Object * > &objects) |
Public Attributes | |
PackedBVH | pack |
BVHParams | params |
vector< Object * > | objects |
string | cache_filename |
Protected Member Functions | |
BVH (const BVHParams ¶ms, const vector< Object * > &objects) | |
bool | cache_read (CacheData &key) |
void | cache_write (CacheData &key) |
void | pack_triangles () |
void | pack_triangle (int idx, float4 woop[3]) |
void | pack_instances (size_t nodes_size) |
virtual void | pack_nodes (const array< int > &prims, const BVHNode *root)=0 |
virtual void | refit_nodes ()=0 |
Definition at line 81 of file intern/cycles/bvh/bvh.h.
virtual BVH::~BVH | ( | ) | [inline, virtual] |
Definition at line 90 of file intern/cycles/bvh/bvh.h.
void BVH::build | ( | Progress & | progress | ) |
Definition at line 145 of file bvh.cpp.
References cache_read(), cache_write(), clear_cache_except(), BVHNode::computeSubtreeSAHCost(), BVHNode::deleteSubtree(), objects, pack, pack_nodes(), pack_triangles(), params, PackedBVH::prim_index, PackedBVH::prim_object, MakeCursor::root, BVHBuild::run(), PackedBVH::SAH, BVHParams::top_level, and BVHParams::use_cache.
Referenced by Mesh::compute_bvh(), and MeshManager::device_update_bvh().
bool BVH::cache_read | ( | CacheData & | key | ) | [protected] |
Definition at line 71 of file bvh.cpp.
References CacheData::add(), Object::bounds, cache_filename, CacheData::get_filename(), Cache::global, PackedBVH::is_leaf, Object::mesh, PackedBVH::nodes, PackedBVH::object_node, objects, pack, params, PackedBVH::prim_index, PackedBVH::prim_object, PackedBVH::prim_visibility, CacheData::read(), PackedBVH::root_index, PackedBVH::SAH, Mesh::transform_applied, PackedBVH::tri_woop, Mesh::triangles, Mesh::verts, and Object::visibility.
Referenced by build().
void BVH::cache_write | ( | CacheData & | key | ) | [protected] |
Definition at line 105 of file bvh.cpp.
References CacheData::add(), cache_filename, CacheData::get_filename(), Cache::global, Cache::insert(), PackedBVH::is_leaf, PackedBVH::nodes, PackedBVH::object_node, pack, PackedBVH::prim_index, PackedBVH::prim_object, PackedBVH::prim_visibility, PackedBVH::root_index, PackedBVH::SAH, and PackedBVH::tri_woop.
Referenced by build().
void BVH::clear_cache_except | ( | ) |
Definition at line 125 of file bvh.cpp.
References Mesh::bvh, cache_filename, Cache::clear_except(), Cache::global, Object::mesh, and objects.
Referenced by build().
Definition at line 61 of file bvh.cpp.
References BVHParams::use_qbvh.
void BVH::pack_instances | ( | size_t | nodes_size | ) | [protected] |
Definition at line 292 of file bvh.cpp.
References Mesh::bvh, BVH_NODE_SIZE, BVH_QNODE_SIZE, array< T >::clear(), data, i, PackedBVH::is_leaf, Object::mesh, PackedBVH::nodes, NULL, PackedBVH::object_node, objects, pack, pack_nodes(), params, PackedBVH::prim_index, PackedBVH::prim_object, PackedBVH::prim_visibility, array< T >::resize(), array< T >::size(), Mesh::transform_applied, Mesh::tri_offset, PackedBVH::tri_woop, BVHParams::use_qbvh, int4::w, int4::x, int4::y, and int4::z.
Referenced by RegularBVH::pack_nodes(), and QBVH::pack_nodes().
virtual void BVH::pack_nodes | ( | const array< int > & | prims, |
const BVHNode * | root | ||
) | [protected, pure virtual] |
Implemented in RegularBVH, and QBVH.
Referenced by build(), and pack_instances().
void BVH::pack_triangle | ( | int | idx, |
float4 | woop[3] | ||
) | [protected] |
Definition at line 229 of file bvh.cpp.
References cross(), dot(), make_float4(), make_transform(), objects, pack, PackedBVH::prim_index, PackedBVH::prim_object, transform_inverse(), Mesh::triangles, Mesh::verts, float4::w, Transform::x, float3::x, float4::x, float3::y, float4::y, Transform::y, float3::z, float4::z, and Transform::z.
Referenced by pack_triangles().
void BVH::pack_triangles | ( | ) | [protected] |
Definition at line 266 of file bvh.cpp.
References array< T >::clear(), i, objects, pack, pack_triangle(), PackedBVH::prim_index, PackedBVH::prim_object, PackedBVH::prim_visibility, array< T >::resize(), array< T >::size(), TRI_NODE_SIZE, PackedBVH::tri_woop, and Object::visibility.
void BVH::refit | ( | Progress & | progress | ) |
Definition at line 216 of file bvh.cpp.
References pack_triangles(), and refit_nodes().
Referenced by Mesh::compute_bvh().
virtual void BVH::refit_nodes | ( | ) | [protected, pure virtual] |
Implemented in RegularBVH, and QBVH.
Referenced by refit().
string BVH::cache_filename |
Definition at line 87 of file intern/cycles/bvh/bvh.h.
Referenced by cache_read(), cache_write(), and clear_cache_except().
vector<Object*> BVH::objects |
Definition at line 86 of file intern/cycles/bvh/bvh.h.
Referenced by build(), cache_read(), clear_cache_except(), Mesh::compute_bvh(), pack_instances(), pack_triangle(), pack_triangles(), and RegularBVH::refit_node().
Definition at line 84 of file intern/cycles/bvh/bvh.h.
Referenced by build(), cache_read(), cache_write(), MeshManager::device_update_bvh(), QBVH::pack_inner(), pack_instances(), RegularBVH::pack_leaf(), QBVH::pack_leaf(), RegularBVH::pack_node(), RegularBVH::pack_nodes(), QBVH::pack_nodes(), pack_triangle(), pack_triangles(), RegularBVH::refit_node(), and RegularBVH::refit_nodes().
Definition at line 85 of file intern/cycles/bvh/bvh.h.
Referenced by build(), cache_read(), pack_instances(), QBVH::pack_nodes(), RegularBVH::pack_nodes(), QBVH::QBVH(), RegularBVH::refit_node(), and RegularBVH::refit_nodes().