CCEffectLighting and CCLightNode - Cutoff radius issues

- Do the lighting distance calculation in 2D. Even though lights have depth values, we should
  do the distance, radius, and falloff calculations in 2D since this is what the user will expect
  when they set a cutoff radius. If the distance calculations are done in 3D then light cutoff radii
  will appear to be smaller than expected.
- Set the default light depth to 100 instead of 500.
CCEffectLighting + CCLightNode - Non-linear falloff support

In addition to the cutoff radius, add a half radius value to CCLightNode. This is the distance at which
a light's intensity has fallen off to 50% of its maximum value. The half radius plus the cutoff radius is
used to construct a piecewise linear falloff function from (0,1) to (half,0.5) to (cutoff,0).
CCEffectUtils - Refactor common ancestor finding into its own function
CCEffectUtils - Refactor finding of transform from node to ancestor into its own function
Making some CGPointExtensions inline.
Adding a CCPhysicsCollisionPair.firstContact property.
Merge branch 'develop' of github.com:cocos2d/cocos2d-iphone into develop
CCEffectLighting -  Move lighting from sprite tangent space to world space

Tangent space doesn't work well when non-uniform scale factors are applied to sprites
and world space handles this better. World space may prove problematic when used with
CCRenderTexture though. More testing is required which is why this is currently in a side
branch.
CCEffectInvert added with ui test.
Merge pull request #1047 from NickyWeber/feature/CCEffectInvert

CCEffectInvert added with ui test.
CCEffectLighting - Link light cutoff radius to light scale

Extract the maximum scale value from each light's node to world transform and use it to scale
the cutoff radius value.
CCEffectUtils - Add a couple GLKMatrix2 helpers to CCEffectUtils
CCEffectLighting - Simplify and correct tangent and binormal setup

- Instead of doing all the math with GLKMatrix4 and GLKVector4, use the 2D versions instead since that's all we need.
- When finding the tangent matrix take the transpose of the inverse of the node's world matrix. This is the proper matrix
to use when transforming surface normals, tangents, etc. and will properly handle non-uniform scales in the world transform.
- When computing the binormal, don't bother doing a full cross-product since the normal is always (0,0,1) and the cross
product of this vector with any tangent is trivial (-ty, tx, 0).
Merge remote-tracking branch 'upstream/develop' into develop
CCEffectLighting - First pass at automatic light collection and light groups

Instead of requiring the user to manually add light nodes to their light effects, automatically
collect all lights in a scene and let the effects query for the closest ones. Which lights
contribute to which effects is controlled similarly to collisions. Lights and effects indicate
which groups they are in and if there is an intersection between a light's groups and an
effect's groups then the light contributes to the effect.

Note: Right now the query is only returning the first N lights not the closest N lights.
CCEffectLighting - Fix computation of sprite position during light collection
CCLightCollection - Use quick select to find N nearest lights

If the caller is requesting fewer lights than there are in the collection, use quick select
to find the nearest N.
CCEffectLighting - Filter the query results based on light radius

In addition to filtering out lights whose group mask doesn't match the query, also
filter out lights whose cutoff radius is less than the distance between the node and
the light.
Merge pull request #1044 from thayerandrews/develop

CCEffectLighting - Cutoff radius, falloff functions, coordinate system issues
CCLightCollection - Distance based filtering of light nodes

I was comparing the distance squared against the radius not the radius squared.