Planet collision attempts:

With numerous attempts to get this collision working I can only get it to partially work.

Starting by adding an event listener on the planet creation for a collision. Within the collision function, create a new mass by adding both planets masses and removing the smaller planets phys and visual objects from the scene and world.

Being able to get this to work has been a gruelling process. I finally managed to figure out the paired objects by using the indexOf the e.with (collision object) and then using that variable inside the array [ ] brackets to determine which three.js object to remove with the phys object.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s