-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raycast
& multiraycast
#136
Comments
I thought we settled for using directions? |
I don't like this as it's sub-optimal to go trough 2 lists just to get the origin and end positions so this @overload
def multiraycast(
origin_positions: Sequence[Coordinate],
end_positions: Sequence[Coordinate],
colliders: Sequence[Rect, Circle, Line],
) -> Sequence[Optional[Tuple[float, float]]]: ... Is a No-No for me. I was thinking of something more like the pygame.Surface.blits() function, in that you pass it a list of containers that represent the surface, where you wanna blit it etc. Basically i was thinking of a very compact approach that accepts a list of tuples that represent a ray, and that ray can be interpreted in various ways @overload
def multiraycast(
rays: Sequence[Ray],
colliders: Sequence[Rect, Circle, Line],
) -> Sequence[Optional[Tuple[float, float]]]: ... Where
Would also be interesting to have an additional parameter that dictates whether @overload
def multiraycast(
rays: Sequence[Ray],
colliders: Sequence[Rect, Circle, Line],
include_miss: bool,
) -> Sequence[Optional[Tuple[float, float]]]: ... And also, given that the majority of the times people will either use a batch of rays with infinite @overload
def multiraycast(
rays: Sequence[Ray],
colliders: Sequence[Rect, Circle, Line],
include_miss: bool,
global_max_dist: float,
) -> Sequence[Optional[Tuple[float, float]]]: ... And with that, given that it's possible that someone might want to set |
It seems that @itzpr3d4t0r has the right idea about optimizing this even further. I just want to be clear that we will not be creating a new I think adding |
I propose to work on this one after #126 is merged, which is pretty close anyway... |
i think the API should look something like this:
it is easy for the user in my opinion
The text was updated successfully, but these errors were encountered: