BabylonJS/Babylon.js — pull request #204 by marcolebdech (2014-05-29 08:40:55+00:00)
Title: Add "layerMask" property for meshes and cameras

Added "layerMask" property to meshes and cameras
---

implementation of Layers from Unity or 3DSMax. Each camera has 32bit mask of layers which it renders ( 1 bit for each layer ) and each mesh has bit-mask of layers, in which it should be rendered.

> There is possible fail if numbers in Javascript interpreter are represented as floats instead of doubles. Float is not precise enough to hold all uint_32 values without deformation.

Default values for both are _0xFFFFFFFF_ (max 32-bit unsigned int), so in default configuration all meshes are rendered in all cameras.

Property is also implemented in .babylon-file parser, so there can be defined meshes connected to various cameras.

[Related forum post here](http://www.html5gamedevs.com/topic/3865-what-do-you-want-in-babylonjs/?p=40350)