Skip to content
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

Limit 3D tracers to units in view #40

Closed
jameslkingsley opened this issue Mar 15, 2016 · 2 comments
Closed

Limit 3D tracers to units in view #40

jameslkingsley opened this issue Mar 15, 2016 · 2 comments
Milestone

Comments

@jameslkingsley
Copy link
Contributor

Right now the new 3D tracers option tracks all (filtered) units on the map regardless of distance or state so it can get quite laggy with lots of AI. What we could do however is only track units that are in the view of the spectator camera. This would be too laggy on an every frame update so it would have to be delayed but essentially it could loop all units and if the unit is in view of the camera then add them to the tracer tracker, else forcefully remove them from the tracker.

@jameslkingsley jameslkingsley added this to the Ongoing milestone Mar 15, 2016
@jameslkingsley
Copy link
Contributor Author

With the new FPS fix this may not be needed anymore. Before the FPS was getting bottle necked by the onFrame event but now it skips 4 frames and the life of a projectile is shorter so each fire event has enough time to process.

@jameslkingsley
Copy link
Contributor Author

Algorithm for this could be to calculate the position boundaries using the camera attributes. For example if we know the position and direction of the camera, we know where the cone of view is. That cone is then altered based on the current FOV setting. With an accurate cone of view, work out the world positions of top left, top right, bottom left, bottom right and then calculate the maximum radius from those positions - this then gives us the center position and radius to search for units.

However all that might be way too slow to run and we'll probably just stick with what we've got now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant