godot_voxel/terrain/voxel_box_mover.h
Marc Gilleron 922f361cb0 Made it compile in Godot 4
- Made a bunch of changes to comply with Godot 4 API
- Use Godot's Vector3i and add the missing stuff with helper functions
- Transvoxel uses custom attributes API, the old way would not work
- Wrap MeshOptimizer in a unique namespace (see build script why)
- Added clang-format file for the module as some rules now differ
- Prevent thirdparty code and lookup tables from being clang-formatted
- Very likely full of runtime bugs that need fixing
2021-12-13 21:38:10 +00:00

27 lines
653 B
C++

#ifndef VOXEL_BOX_MOVER_H
#define VOXEL_BOX_MOVER_H
#include "voxel_terrain.h"
#include <core/math/aabb.h>
// Helper to get simple AABB physics
class VoxelBoxMover : public RefCounted {
GDCLASS(VoxelBoxMover, RefCounted)
public:
Vector3 get_motion(Vector3 pos, Vector3 motion, AABB aabb, VoxelTerrain *terrain);
void set_collision_mask(uint32_t mask);
inline uint32_t get_collision_mask() const {
return _collision_mask;
}
private:
Vector3 _b_get_motion(Vector3 p_pos, Vector3 p_motion, AABB p_aabb, Node *p_terrain_node);
static void _bind_methods();
uint32_t _collision_mask = 0xffffffff; // Everything
};
#endif // VOXEL_BOX_MOVER_H