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

Camera.cull using || instead of && for area check #3646

Closed
Yora opened this issue May 6, 2018 · 0 comments
Closed

Camera.cull using || instead of && for area check #3646

Yora opened this issue May 6, 2018 · 0 comments

Comments

@Yora
Copy link

Yora commented May 6, 2018

In Camera.cull, culledObjects is to be populated by objects within the camera area, but currently returns all objects given no matter what because the area is being checked with OR instead of AND.
if (tx > -objectW || ty > -objectH || tx < cullW || ty < cullH || tw > -objectW || th > -objectH || tw < cullW || th < cullH) { culledObjects.push(object); }
Can be fixed by changing all ORs to ANDs
if (tx > -objectW && ty > -objectH && tx < cullW && ty < cullH && tw > -objectW && th > -objectH && tw < cullW && th < cullH) { culledObjects.push(object); }

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

2 participants