Lock the 3d Physics engine to 2d plane on a Bezier Curve

Godot Version

4.2.2 but question is more open ended.


Hi Everyone!

If I wanted to limit the 3d physics engine to a 2d plane, so the collision interactions are only simulated in 2d space, then shape that plane with a bezier curve, how would I begin?

(I have a render I did in Blender to demo what I mean, but I’m a new user to the forum, so no attachment upload. If I’m able to later, I will edit this post to make the attachment, but for now I will link to a Lemmy instance with my demo.)

The attached demo is a simulation I did on Blender showing the type of interaction I mean. The green wire mesh represents a vertical plane that has the horizontal edge shaped by a bezier curve. The ball has a physics simulation on the up and down (z axis) with only horizontal movement on the (let’s call it the c-axis). So, all linear movement on the c-axis is translated to a x and y position using the bezier plane.

My initial thoughts on how I might approach such a setup would be to create all nodes in 3d space except for the physics shapes. This might allow using the 2d physics shape but keep the 3d model meshes and lights. But the it would have to be a 2d RigidBody, and I’m not sure if I could translate a 2d position space to a 3d position space … I think I need a broader understanding of the core code of Godot. In the past, I’ve been successful in a c++ Godot module, then later refactoring it to a GDExtension. But that was needed for a high performant line gesture engine. I haven’t yet delved too much into the guts of Godot.

Any pointers? Or inspired thoughts?