Add a control point to the CatmullRomCurve3

I want to create a new control point where the user clicks to the curve. Is there any way to add a control point exactly where the ray-caster meets the line constructed from the curve points.

I can add a control point at the of the curve or in the middle of the curve if I know the position of the control point relative to knew one.
Here is my experiment :

Pls, have a look at addControlPoint(vector3, afterPosition)
Any suggestion? Thank you and happy new year!

1 Like