-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
perf(Visibility): adding SpatialHash components #982
base: main
Are you sure you want to change the base?
Conversation
SonarCloud Quality Gate failed. |
0e571ba
to
3d46d9f
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
float fx = position.x - Offset.x; | ||
float fy = position.y - Offset.y; | ||
|
||
x = Mathf.RoundToInt(fx / GridSize.x); | ||
y = Mathf.RoundToInt(fy / GridSize.y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently bugged near edge, might need extra offset of GridSize/2
or something.
Unit tests would be good for this function.
/// <returns>True if the player can see this object.</returns> | ||
public override bool OnCheckObserver(INetworkPlayer player) | ||
{ | ||
ThrowIfNoSystem(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should return and wait for system instead of throw. System can rebuild existing NI when it starts.
This is to better deal with spawning objects inside server.Started
, the system might not be first in even list
No description provided.