Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/bvh/bvh_build.cpp
| Show First 20 Lines • Show All 264 Lines • ▼ Show 20 Lines | for (int k = 0; k < curve.num_keys - 1; k++) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void BVHBuild::add_reference_geometry(BoundBox &root, BoundBox ¢er, Geometry *geom, int i) | void BVHBuild::add_reference_geometry(BoundBox &root, BoundBox ¢er, Geometry *geom, int i) | ||||
| { | { | ||||
| if (geom->type == Geometry::MESH) { | if (geom->type == Geometry::MESH || geom->type == Geometry::VOLUME) { | ||||
| Mesh *mesh = static_cast<Mesh *>(geom); | Mesh *mesh = static_cast<Mesh *>(geom); | ||||
| add_reference_triangles(root, center, mesh, i); | add_reference_triangles(root, center, mesh, i); | ||||
| } | } | ||||
| else if (geom->type == Geometry::HAIR) { | else if (geom->type == Geometry::HAIR) { | ||||
| Hair *hair = static_cast<Hair *>(geom); | Hair *hair = static_cast<Hair *>(geom); | ||||
| add_reference_curves(root, center, hair, i); | add_reference_curves(root, center, hair, i); | ||||
| } | } | ||||
| } | } | ||||
| Show All 12 Lines | static size_t count_curve_segments(Hair *hair) | ||||
| for (size_t i = 0; i < num_curves; i++) | for (size_t i = 0; i < num_curves; i++) | ||||
| num += hair->get_curve(i).num_keys - 1; | num += hair->get_curve(i).num_keys - 1; | ||||
| return num; | return num; | ||||
| } | } | ||||
| static size_t count_primitives(Geometry *geom) | static size_t count_primitives(Geometry *geom) | ||||
| { | { | ||||
| if (geom->type == Geometry::MESH) { | if (geom->type == Geometry::MESH || geom->type == Geometry::VOLUME) { | ||||
| Mesh *mesh = static_cast<Mesh *>(geom); | Mesh *mesh = static_cast<Mesh *>(geom); | ||||
| return mesh->num_triangles(); | return mesh->num_triangles(); | ||||
| } | } | ||||
| else if (geom->type == Geometry::HAIR) { | else if (geom->type == Geometry::HAIR) { | ||||
| Hair *hair = static_cast<Hair *>(geom); | Hair *hair = static_cast<Hair *>(geom); | ||||
| return count_curve_segments(hair); | return count_curve_segments(hair); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 830 Lines • Show Last 20 Lines | |||||