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:


Comets like this:


And container like this:


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.

Leave a Reply

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

You are commenting using your 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