Skip to main content
17 events
when toggle format what by license comment
Mar 9, 2021 at 14:33 vote accept Mendes
Mar 3, 2021 at 19:06 history bumped CommunityBot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Feb 1, 2021 at 18:51 history edited Mendes CC BY-SA 4.0
deleted 249 characters in body
Feb 1, 2021 at 18:48 answer added Mendes timeline score: 2
Feb 1, 2021 at 14:18 comment added Mendes @Sacha, DMGregory, this is for educational purpose, learn another approach can't hurt, if you have keywords (or link to tutorials). Keelhaul, "the increased force is counterbalanced by the increased inertia", I still don't understand very well why, but this is another question, thanks
Feb 1, 2021 at 8:28 comment added Keelhaul The "ah" you currently compute is the force, not the acceleration. To get the latter, remove the asteroid.mass (a more massive asteroid must not fall faster, the increased force is counterbalanced by the increased inertia, hence why the asteroid mass is irrelevant to get the gravitationnal acceleration)
Jan 31, 2021 at 17:31 comment added DMGregory Note that we lack analytic solutions for 3+ interacting bodies in the general case, so if you have plans to go beyond interactions with a single pair you may be forced to stick to step-based numerical integration methods.
Jan 31, 2021 at 17:13 comment added Sacha Are you interested in actually simulating it step-by-step by integration, or are you open to analytical solutions?
Jan 31, 2021 at 16:07 history rollback Mendes
Rollback to Revision 2
Jan 31, 2021 at 16:06 history edited Mendes CC BY-SA 4.0
deleted 249 characters in body
Jan 31, 2021 at 15:59 history edited Mendes CC BY-SA 4.0
added 249 characters in body
Jan 31, 2021 at 15:57 comment added Mendes Haha, not false ^^. I updated code thanks again, the code was updated
Jan 31, 2021 at 15:51 comment added DMGregory Re: bottlenecks, compare the costs of one square root and one division versus three trig functions: an arctangent, a cosine, and a sine.
Jan 31, 2021 at 15:48 comment added Mendes Actually this working well, (just need handle case where d=0). I started using a wrong method (movements looks good but values was totally wrong). So I want to be sure it's the right way todo. Vector normalization ? That was the thing I tried to do but with big misconception (like this ugly thing: ax = ah * (x*x/d)). This is too early but sqrt() isn't bottleneck ? simulation will take lot of object/planets. I keep it in a side, thank you!
Jan 31, 2021 at 15:21 comment added DMGregory You can replace your trigonometry with a vector normalization instead (ax = x * (ah / sqrt(d))) but otherwise this looks reasonable. Is there anything you're unsatisfied with about how this is performing in your game?
Jan 31, 2021 at 15:10 review First posts
Feb 1, 2021 at 19:40
Jan 31, 2021 at 15:08 history asked Mendes CC BY-SA 4.0