Customizing move_and_slide with GDExtension

Godot Version



My goal is to develop a voxel GDExtension that can handle large voxel engines efficiently similar to Minecraft or Vintage Story. I think the best way to do that is to use voxel swept AABB for collision detection, instead of relying on static bodies like Zylann’s voxel extension does. However, I need to access the move and slide function for this, and I don’t know how to do that with GDExtension. I looked into the godot::PhysicsServer3d class and its related files, but I couldn’t find anything useful. Is there a way to access move and slide with GDExtension? Or would I have to fork the Godot engine itself?

I should clarify, I already know how to implement these things (chunks, generation, collision, etc)- or at least the baseline on how to implement a rudimentary voxel engine. I just want to port my implementation to Godot using GDExtension and collision has stumped me.

The move and slide functionality only exists in CharacterBody3D I think, if you’re not using character bodies and want the same thing you would need to recreate the functionality

I believe you are right about it only existing in the godot::CharacterBody3D which is indeed the type I am using for my Player object. I neglected to mention that I want my Player object to inherit from godot::CharacterBody3D, since it has the ability to interact with various kinds of objects. My goal is to enhance its functionality to enable collision with voxels.