Added point-in-triangle detection.