Skip to content

Particle::do_motor_behaviours doesn't recognize all the cases of the face change possibility #50

@kolayne

Description

@kolayne

Not only the map_node neighbours but also their neighbours should be checked in this piece of code:

MapNode *node_neighbors[] = {map_node->get_left(), map_node->get_top(), map_node->get_right(),
map_node->get_bottom()};
for(MapNode *neighbor : node_neighbors)
{
if(neighbor->get_face() != map_node->get_face()) // If any of the neighbor nodes is on a different face
{
// Then particle might move to a different face, so project coordinates to the polyhedron's surface
end = get_projected_vector_end(coordinates, end, map_node->get_face(), map_node->get_polyhedron());
break;
}
}

I would really appreciate a comment from @tanya-kta with a pretty detailed explanation of the reason for this (probably with a picture)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions