Gravity simulator 3D – update

If you haven’t already, read the contents of this previous post.

This time I made a couple of changes, including the bug fixes I specified in my last post. Primarily I worked on fixing the glitch where two particles could launch off each other if they approached in a certain way:

Oops! This image failed to load.
Problem in red, resolve in green

Now that I have fixed this, it makes the simulation much more realistic. Also, I added an anchored variable to the cubegen sequence:

int mass

Sets the mass of the object. This will affect its acceleration rate and size.

col colour

Sets the colour of the object on screen.

int[] position

Sets the initial position of the object.

BETA int[] initialVelocity

Sets the initial velocity of the object

boolean anchored

Sets whether the object is anchored

I still have much further to on bug-fixing, but hopefully this is a step towards a better simulator!

View project

One thought on “Gravity simulator 3D – update

Leave a Reply

Your email address will not be published. Required fields are marked *