feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -34,10 +34,10 @@
#include "core/templates/pair.h"
#include "scene/resources/surface_tool.h"
#ifndef _3D_DISABLED
#ifndef PHYSICS_3D_DISABLED
#include "scene/resources/3d/concave_polygon_shape_3d.h"
#include "scene/resources/3d/convex_polygon_shape_3d.h"
#endif // _3D_DISABLED
#endif // PHYSICS_3D_DISABLED
void MeshConvexDecompositionSettings::set_max_concavity(real_t p_max_concavity) {
max_concavity = CLAMP(p_max_concavity, 0.001, 1.0);
@ -201,7 +201,9 @@ void MeshConvexDecompositionSettings::_bind_methods() {
BIND_ENUM_CONSTANT(CONVEX_DECOMPOSITION_MODE_TETRAHEDRON);
}
#ifndef PHYSICS_3D_DISABLED
Mesh::ConvexDecompositionFunc Mesh::convex_decomposition_function = nullptr;
#endif // PHYSICS_3D_DISABLED
int Mesh::get_surface_count() const {
int ret = 0;
@ -521,7 +523,7 @@ Vector<Face3> Mesh::get_surface_faces(int p_surface) const {
return Vector<Face3>();
}
#ifndef _3D_DISABLED
#ifndef PHYSICS_3D_DISABLED
Ref<ConvexPolygonShape3D> Mesh::create_convex_shape(bool p_clean, bool p_simplify) const {
if (p_simplify) {
Ref<MeshConvexDecompositionSettings> settings = Ref<MeshConvexDecompositionSettings>();
@ -563,7 +565,7 @@ Ref<ConvexPolygonShape3D> Mesh::create_convex_shape(bool p_clean, bool p_simplif
Ref<ConcavePolygonShape3D> Mesh::create_trimesh_shape() const {
Vector<Face3> faces = get_faces();
if (faces.size() == 0) {
if (faces.is_empty()) {
return Ref<ConcavePolygonShape3D>();
}
@ -581,7 +583,7 @@ Ref<ConcavePolygonShape3D> Mesh::create_trimesh_shape() const {
shape->set_faces(face_points);
return shape;
}
#endif // _3D_DISABLED
#endif // PHYSICS_3D_DISABLED
Ref<Mesh> Mesh::create_outline(float p_margin) const {
Array arrays;
@ -615,7 +617,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const {
if (j == ARRAY_VERTEX) {
vcount = src.size();
}
if (dst.size() == 0 || src.size() == 0) {
if (dst.is_empty() || src.is_empty()) {
arrays[j] = Variant();
continue;
}
@ -627,7 +629,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const {
case ARRAY_WEIGHTS: {
Vector<real_t> dst = arrays[j];
Vector<real_t> src = a[j];
if (dst.size() == 0 || src.size() == 0) {
if (dst.is_empty() || src.is_empty()) {
arrays[j] = Variant();
continue;
}
@ -638,7 +640,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const {
case ARRAY_COLOR: {
Vector<Color> dst = arrays[j];
Vector<Color> src = a[j];
if (dst.size() == 0 || src.size() == 0) {
if (dst.is_empty() || src.is_empty()) {
arrays[j] = Variant();
continue;
}
@ -650,7 +652,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const {
case ARRAY_TEX_UV2: {
Vector<Vector2> dst = arrays[j];
Vector<Vector2> src = a[j];
if (dst.size() == 0 || src.size() == 0) {
if (dst.is_empty() || src.is_empty()) {
arrays[j] = Variant();
continue;
}
@ -661,7 +663,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const {
case ARRAY_INDEX: {
Vector<int> dst = arrays[j];
Vector<int> src = a[j];
if (dst.size() == 0 || src.size() == 0) {
if (dst.is_empty() || src.is_empty()) {
arrays[j] = Variant();
continue;
}
@ -900,7 +902,7 @@ void Mesh::clear_cache() const {
debug_lines.clear();
}
#ifndef _3D_DISABLED
#ifndef PHYSICS_3D_DISABLED
Vector<Ref<Shape3D>> Mesh::convex_decompose(const Ref<MeshConvexDecompositionSettings> &p_settings) const {
ERR_FAIL_NULL_V(convex_decomposition_function, Vector<Ref<Shape3D>>());
@ -937,7 +939,7 @@ Vector<Ref<Shape3D>> Mesh::convex_decompose(const Ref<MeshConvexDecompositionSet
return ret;
}
#endif // _3D_DISABLED
#endif // PHYSICS_3D_DISABLED
int Mesh::get_builtin_bind_pose_count() const {
return 0;
@ -2030,7 +2032,7 @@ AABB ArrayMesh::get_custom_aabb() const {
}
void ArrayMesh::regen_normal_maps() {
if (surfaces.size() == 0) {
if (surfaces.is_empty()) {
return;
}
Vector<Ref<SurfaceTool>> surfs;
@ -2297,10 +2299,10 @@ void ArrayMesh::_bind_methods() {
ClassDB::bind_method(D_METHOD("surface_find_by_name", "name"), &ArrayMesh::surface_find_by_name);
ClassDB::bind_method(D_METHOD("surface_set_name", "surf_idx", "name"), &ArrayMesh::surface_set_name);
ClassDB::bind_method(D_METHOD("surface_get_name", "surf_idx"), &ArrayMesh::surface_get_name);
#ifndef _3D_DISABLED
#ifndef PHYSICS_3D_DISABLED
ClassDB::bind_method(D_METHOD("create_trimesh_shape"), &ArrayMesh::create_trimesh_shape);
ClassDB::bind_method(D_METHOD("create_convex_shape", "clean", "simplify"), &ArrayMesh::create_convex_shape, DEFVAL(true), DEFVAL(false));
#endif // _3D_DISABLED
#endif // PHYSICS_3D_DISABLED
ClassDB::bind_method(D_METHOD("create_outline", "margin"), &ArrayMesh::create_outline);
ClassDB::bind_method(D_METHOD("regen_normal_maps"), &ArrayMesh::regen_normal_maps);
ClassDB::set_method_flags(get_class_static(), _scs_create("regen_normal_maps"), METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR);