Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/ipc/broad_phase/sweep_and_tiniest_queue.cu
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ void SweepAndTiniestQueue::build(
boxes->vertices[i].max.z =
vertex_boxes[i].max.size() > 2 ? vertex_boxes[i].max.z() : 0;

boxes->vertices[i].min.x = vertex_boxes[i].vertex_ids[0];
boxes->vertices[i].min.y = vertex_boxes[i].vertex_ids[1];
boxes->vertices[i].min.z = vertex_boxes[i].vertex_ids[2];
// If vertex id == -1 it means this slot is not used.
// But Scalable CCD does not have this kind of special value so we map
// it to unique negative id.
const auto [vi, vj, vk] = vertex_boxes[i].vertex_ids;
assert(vi >= 0);
boxes->vertices[i].vertex_ids.x = vi;
boxes->vertices[i].vertex_ids.y = vj >= 0 ? vj : (-vi - 1);
boxes->vertices[i].vertex_ids.z = vk >= 0 ? vk : (-vi - 1);

boxes->vertices[i].element_id = i;
}
Expand Down Expand Up @@ -271,4 +276,4 @@ bool SweepAndTiniestQueue::can_faces_collide(size_t fai, size_t fbi) const

} // namespace ipc

#endif
#endif