New obstacle class that has many obstacles of same type? #141
Labels
decision
We must decide if and how should this be done
documentation
Needs documentation, or requires change in current documentation
hard
new billiard
performance
Will improve performance
tests
This issue/PR needs tests
So, let's say a user wants to create hundredths of disks in a billiard. Currently this will make a tuple of this amount of obstacles. Maybe that is not super performant since the tuple is parameterized for each individual entry, even if they are the same.
I propose to create a new struct,
ObstacleVector{O, T}
that is parameterized on an obstacleO
and the number type.For this to work we simply have to propagate the collision time methods to simply loop over all obstacles in the vector. The same for
distance
, etc etc.The only difficulty is that this messes with the obstacle index
i
. Because when you writei, tmin = next_collision(bd, p)
what willi
be? The billiard can have some wall obstacles and anObstacleVector
obstacle. How to do this?Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: