Commit e6b8d2d0 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[BVH] Fix BVHModelBase::buildConvexRepresentation

parent 44254981
......@@ -82,7 +82,16 @@ BVHModelBase::BVHModelBase(const BVHModelBase& other) :
void BVHModelBase::buildConvexRepresentation(bool share_memory)
{
if (!convex) {
convex.reset(new Convex<Triangle>(!share_memory, vertices, num_vertices, tri_indices, num_vertices));
Vec3f* points = vertices;
Triangle* polygons = tri_indices;
if (!share_memory) {
points = new Vec3f[num_vertices];
memcpy(points, vertices, sizeof(Vec3f) * num_vertices);
polygons = new Triangle[num_tris];
memcpy(polygons, tri_indices, sizeof(Triangle) * num_tris);
}
convex.reset(new Convex<Triangle>(!share_memory, points, num_vertices, polygons, num_vertices));
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment