An Optimization-Based Inverse Kinematics Solver for Continuum Manipulators in Intricate Environments