diff --git a/src/simulation.cpp b/src/simulation.cpp index 62f0bd2d2..00d9d391d 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -541,9 +541,7 @@ void process_collision_events() // If next level is rotated, apply rotation matrix const auto& m {model::cells[p->coord_[j].cell]->rotation_}; const auto& u {p->coord_[j].u}; - p->coord_[j + 1].u.x = m[3]*u.x + m[4]*u.y + m[5]*u.z; - p->coord_[j + 1].u.y = m[6]*u.x + m[7]*u.y + m[8]*u.z; - p->coord_[j + 1].u.z = m[9]*u.x + m[10]*u.y + m[11]*u.z; + p->coord_[j + 1].u = u.rotate(m); } else { // Otherwise, copy this level's direction p->coord_[j+1].u = p->coord_[j].u;