Real-time collision detection for motion simulation within complex environments