Container bug fix:

Cannon.js has a neat little function which lets you set collision filter groups and masks on objects.

By going through my object creation functions and setting the groups they are in and masks that they can collide with I was able to solve this problem for example by setting the moons and planets like so:

Image

Comets like this:

Image

And container like this:

Image

The collisionGrp and collisionMasks are both parameters passed on the container creation, like so:

Screen Shot 2014-05-22 at 15.22.10

I am able to determine whitch objects can be affected by other objects collision and forces.

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