Update shape3d vertices without using set_shape

Godot Version

4.2.1

Question

I was wondering if there was a way to update the shape3d vertices without actually setting the data again. I know the index of the vertices I need to change for the shape, but using set_shape every frame I need too is too expensive since my shape has over a hundred thousand vertices.

Is this something that would only be doable if I modified the cpp source and rebuilt Godot? I’ve traced the set_data function back to the physics_server_3d.cpp but don’t know enough about c++ to know where to go from here. I did find PhysicsServer3D::get_singleton()->shape_set_data(get_shape(), d); in the ConcavePolygonShape3D file, but not really sure how to reference the “d” data afterwards to update the vertices. Any ideas on this would be awesome

One solution I have thought about is to create multiple collision shapes and then creating new ones would be cheaper, but it would be best if I could just edit the shape vertices directly.

From what I’m seeing it looks like struct GodotConcavePolygonShape3D : public GodotConcaveShape3D is created for the Shape3D. Would I be able to edit the vertices inside the Vector<Vector3> vertices directly? I’m not sure if the Vector<Vector3> vertices is a reference or an actual copy of the information. If it’s a reference, shouldn’t I be able to edit it still and the GodotConcavePolygonShape3D would still reference the same but now edited Vector3’s?