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

perf(Visibility): adding SpatialHash components #982

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

James-Frowen
Copy link
Member

No description provided.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 1, 2021

SonarCloud Quality Gate failed.    Quality Gate failed

Bug B 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@dragonslaya84 dragonslaya84 added the keep-open Stops issue being closed because it is stale label Jan 22, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Comment on lines +219 to +223
float fx = position.x - Offset.x;
float fy = position.y - Offset.y;

x = Mathf.RoundToInt(fx / GridSize.x);
y = Mathf.RoundToInt(fy / GridSize.y);
Copy link
Member Author

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();
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep-open Stops issue being closed because it is stale Needs testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants