-
Notifications
You must be signed in to change notification settings - Fork 84
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
Cleaned up the code #4
Conversation
…ore heavy computations
Thanks, I'll check this out! Did you notice I just fixed collisions..? |
@pakastin Yes, I've merged it already. But acceleration is still kinda broken, look into calculating it using trigonometry. |
Cool, you're fast! ;) |
Which part of the gravitation math needs fixing? |
The issue is that the code doesn't follow almost any standards.
Regarding gravitation: |
Sorry, I still don't understand how your lines differ:
About those standards: I use standard code style and don't like ES6 classes / fat arrows.. I agree with the mess though – will refactor it my way, but merge to this pull request. Thank you so much for contribution! |
@pakastin They don't. I've not fixed it. |
I just don't like the ugly code babel makes with classes and fat arrows..but you have great things going on – I'll show you my fixes in a moment.. |
What he means is that xAccB is using nodeA's mass, instead of B's mass. |
@pakastin Should I merge your new commits to this PR? |
I can fix this, no worries ;) Thank you so much – works great now! |
Thanks for contribution! |
You have not implemented squareddistance check which i think is a great performance improvement. I'll contribute tomorrow by implementing #1 and some nicer screen edge behavior. |
I'm happy to merge, sorry I made this refactoring straight to the master branch, but there would've been something like 99.9% undoing and too much of a hassle pulling/pushing. Hope you're ok with my code style. Didn't have time to investigate the square root optimization any further. I did realize there's more squaring than square rooting going on, so I believe it would make a difference. If you want you can make pull request for it. I didn't notice your fix on setting fill and night check, sounds good also – I let that one for you to pull request as well if you want. Don't want to "steal" your contributions any more ;) |
Cleaned it up and optimized a little.
Also you might look into your gravity/acceleration math because it's broken.