diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-03-29 16:03:46 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-03-29 16:03:46 +0400 |
commit | 0509553b5eb240b3970848a4432e0bbfcbba8690 (patch) | |
tree | dd0d7281e3f88ba22aacb6543f0d3000f4c2ed74 /intern/cycles/bvh/bvh_split.cpp | |
parent | 24ad7e0bea77d942267344990d22e931610c3d07 (diff) |
Cycles code refactor: changes to make adding new primitive types easier.
Diffstat (limited to 'intern/cycles/bvh/bvh_split.cpp')
-rw-r--r-- | intern/cycles/bvh/bvh_split.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/intern/cycles/bvh/bvh_split.cpp b/intern/cycles/bvh/bvh_split.cpp index 03ff69d7b6d..864626da134 100644 --- a/intern/cycles/bvh/bvh_split.cpp +++ b/intern/cycles/bvh/bvh_split.cpp @@ -253,7 +253,7 @@ void BVHSpatialSplit::split_reference(BVHBuild *builder, BVHReference& left, BVH Object *ob = builder->objects[ref.prim_object()]; const Mesh *mesh = ob->mesh; - if (ref.prim_segment() == ~0) { + if (ref.prim_type() & PRIMITIVE_ALL_TRIANGLE) { const int *inds = mesh->triangles[ref.prim_index()].v; const float3 *verts = &mesh->verts[0]; const float3* v1 = &verts[inds[2]]; @@ -282,7 +282,7 @@ void BVHSpatialSplit::split_reference(BVHBuild *builder, BVHReference& left, BVH } else { /* curve split: NOTE - Currently ignores curve width and needs to be fixed.*/ - const int k0 = mesh->curves[ref.prim_index()].first_key + ref.prim_segment(); + const int k0 = mesh->curves[ref.prim_index()].first_key + PRIMITIVE_UNPACK_SEGMENT(ref.prim_type()); const int k1 = k0 + 1; const float3* v0 = &mesh->curve_keys[k0].co; const float3* v1 = &mesh->curve_keys[k1].co; @@ -318,8 +318,8 @@ void BVHSpatialSplit::split_reference(BVHBuild *builder, BVHReference& left, BVH right_bounds.intersect(ref.bounds()); /* set references */ - left = BVHReference(left_bounds, ref.prim_index(), ref.prim_object(), ref.prim_segment()); - right = BVHReference(right_bounds, ref.prim_index(), ref.prim_object(), ref.prim_segment()); + left = BVHReference(left_bounds, ref.prim_index(), ref.prim_object(), ref.prim_type()); + right = BVHReference(right_bounds, ref.prim_index(), ref.prim_object(), ref.prim_type()); } CCL_NAMESPACE_END |