nl_tokens: When walking on complex surfaces ( trimeshes borders between two shapes ) the collision normals returned for the player sphere can be very inconsistent . To address this raycast straight down find the collision normal and return whichever normal is more vertical .
pl_tokens: function ( groundBody , groundNormal ) { let ray , hitNormal , vFrom = this . body . position , vTo = this . body . position . clone ( ) ; ray = new CANNON . Ray ( vFrom , vTo ) ; ray . _updateDirection ( ) ; // TODO - Report bug. ray . intersectBody ( groundBody ) ; if ( ! ray . hasHit ) return groundNormal ; // Compare ABS, in case we're projecting against the inside of the face. hitNormal = ray . <mask> . hitNormalWorld ; return Math . abs ( hitNormal . y ) > Math . abs ( groundNormal . y ) ? hitNormal : groundNormal ; }