Fixes a few typos/bugs in contact related files.

Fix bug in collisionDetectTerrain.m
Fix varargin usage in contactConstraintsBV
Fix definition of nk in contactConstraintsBV
Add check for mex pointer in collisionDetect

Also removes the ugly bit of code that called doKinematics with mex enabled if
the method received a kinsol with mex disabled. Now if the kinsol is non-mex or
if there is no mex pointer in the RBM, collisionDetect only performs collision
detection between elegible terrain contact points and the terrain.
add default implementation of RigidBodyTerrain.writeWRL method
Merge pull request #126 from avalenzu/collision-bug-fixes

Collision bug fixes
Added flat terain to runatlasdynamics test.
Merge pull request #127 from mposa/master-bugfix

Added flat terain to runatlasdynamics test.
fix for dircol glider bug from ani
more robust path handling (especially for windows)
Implement the MATLAB version of FootStepConstraint, will work on C++ implementation
Rename 'FootStepConstraint' to 'FootStepRegionConstraint'
Move the commits from drc sandbox to drake. Almost finished the P step of the bilinear alternation
P step is numerically correct. Need to add some kinematic constraint on the distance between CoM and the contact points, so that the contact position makes sense
add a function addKinematicPolygon in the P step to encode the relative position between contact bodies. Will need to work on RelativeFootPositionPolygon to specify such position constraint
RelativeFOotPositionPolygon is implemented to encode the polygonal constraint on the foot location w.r.t the other foot
P step supports a polygonal region constraint on the xy position between contact bodies
Start to work on the 'F-step' of the bilinear alternation. But I will take a step backward and add the time as decision variables in the formulation first
P-step uses less internal storage for the FootStepRegionContactConstraint
P-step now accepts time scaling as input of the optimization
P-step can specify the bounds on the CoM velocity
P-step can run optimization now. Need to check the solution. Will also add constraint on the time interval between consecutive knot points; such constraint are second order cone constraint with additional variables