diff options
Diffstat (limited to 'intern/cycles/bvh/bvh_unaligned.cpp')
-rw-r--r-- | intern/cycles/bvh/bvh_unaligned.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/intern/cycles/bvh/bvh_unaligned.cpp b/intern/cycles/bvh/bvh_unaligned.cpp index 1843ca403a5..f0995f343fe 100644 --- a/intern/cycles/bvh/bvh_unaligned.cpp +++ b/intern/cycles/bvh/bvh_unaligned.cpp @@ -16,7 +16,7 @@ #include "bvh/bvh_unaligned.h" -#include "render/mesh.h" +#include "render/hair.h" #include "render/object.h" #include "bvh/bvh_binning.h" @@ -71,10 +71,10 @@ bool BVHUnaligned::compute_aligned_space(const BVHReference &ref, Transform *ali if (type & PRIMITIVE_CURVE) { const int curve_index = ref.prim_index(); const int segment = PRIMITIVE_UNPACK_SEGMENT(packed_type); - const Mesh *mesh = object->mesh; - const Mesh::Curve &curve = mesh->get_curve(curve_index); + const Hair *hair = static_cast<const Hair *>(object->geometry); + const Hair::Curve &curve = hair->get_curve(curve_index); const int key = curve.first_key + segment; - const float3 v1 = mesh->curve_keys[key], v2 = mesh->curve_keys[key + 1]; + const float3 v1 = hair->curve_keys[key], v2 = hair->curve_keys[key + 1]; float length; const float3 axis = normalize_len(v2 - v1, &length); if (length > 1e-6f) { @@ -96,10 +96,10 @@ BoundBox BVHUnaligned::compute_aligned_prim_boundbox(const BVHReference &prim, if (type & PRIMITIVE_CURVE) { const int curve_index = prim.prim_index(); const int segment = PRIMITIVE_UNPACK_SEGMENT(packed_type); - const Mesh *mesh = object->mesh; - const Mesh::Curve &curve = mesh->get_curve(curve_index); + const Hair *hair = static_cast<const Hair *>(object->geometry); + const Hair::Curve &curve = hair->get_curve(curve_index); curve.bounds_grow( - segment, &mesh->curve_keys[0], &mesh->curve_radius[0], aligned_space, bounds); + segment, &hair->curve_keys[0], &hair->curve_radius[0], aligned_space, bounds); } else { bounds = prim.bounds().transformed(&aligned_space); |