feat: updated engine
This commit is contained in:
parent
cbe99774ff
commit
f4cf6b3999
6607 changed files with 910135 additions and 430025 deletions
|
|
@ -30,7 +30,11 @@
|
|||
|
||||
#include "mesh_instance_3d.h"
|
||||
|
||||
#include "core/object/callable_mp.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "scene/3d/skeleton_3d.h"
|
||||
#include "scene/main/scene_tree.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
||||
#ifndef PHYSICS_3D_DISABLED
|
||||
#include "scene/3d/physics/collision_shape_3d.h"
|
||||
|
|
@ -43,7 +47,11 @@
|
|||
#include "scene/resources/3d/navigation_mesh_source_geometry_data_3d.h"
|
||||
#include "scene/resources/navigation_mesh.h"
|
||||
#include "servers/navigation_3d/navigation_server_3d.h"
|
||||
#endif // NAVIGATION_3D_DISABLED
|
||||
|
||||
#include <cfloat> // FLT_EPSILON
|
||||
|
||||
#ifndef NAVIGATION_3D_DISABLED
|
||||
Callable MeshInstance3D::_navmesh_source_geometry_parsing_callback;
|
||||
RID MeshInstance3D::_navmesh_source_geometry_parser;
|
||||
#endif // NAVIGATION_3D_DISABLED
|
||||
|
|
@ -62,8 +70,8 @@ bool MeshInstance3D::_set(const StringName &p_name, const Variant &p_value) {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (p_name.operator String().begins_with("surface_material_override/")) {
|
||||
int idx = p_name.operator String().get_slicec('/', 1).to_int();
|
||||
if (p_name.string().begins_with("surface_material_override/")) {
|
||||
int idx = p_name.string().get_slicec('/', 1).to_int();
|
||||
|
||||
if (idx >= surface_override_materials.size() || idx < 0) {
|
||||
return false;
|
||||
|
|
@ -87,8 +95,8 @@ bool MeshInstance3D::_get(const StringName &p_name, Variant &r_ret) const {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (p_name.operator String().begins_with("surface_material_override/")) {
|
||||
int idx = p_name.operator String().get_slicec('/', 1).to_int();
|
||||
if (p_name.string().begins_with("surface_material_override/")) {
|
||||
int idx = p_name.string().get_slicec('/', 1).to_int();
|
||||
if (idx >= surface_override_materials.size() || idx < 0) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -134,6 +142,7 @@ void MeshInstance3D::set_mesh(const Ref<Mesh> &p_mesh) {
|
|||
}
|
||||
|
||||
notify_property_list_changed();
|
||||
update_configuration_warnings();
|
||||
}
|
||||
|
||||
Ref<Mesh> MeshInstance3D::get_mesh() const {
|
||||
|
|
@ -562,7 +571,7 @@ Ref<ArrayMesh> MeshInstance3D::bake_mesh_from_current_blend_shape_mix(Ref<ArrayM
|
|||
|
||||
const Array &source_mesh_arrays = source_mesh->surface_get_arrays(surface_index);
|
||||
|
||||
ERR_FAIL_COND_V(source_mesh_arrays.size() != RS::ARRAY_MAX, Ref<ArrayMesh>());
|
||||
ERR_FAIL_COND_V(source_mesh_arrays.size() != RSE::ARRAY_MAX, Ref<ArrayMesh>());
|
||||
|
||||
const Vector<Vector3> &source_mesh_vertex_array = source_mesh_arrays[Mesh::ARRAY_VERTEX];
|
||||
const Vector<Vector3> &source_mesh_normal_array = source_mesh_arrays[Mesh::ARRAY_NORMAL];
|
||||
|
|
@ -739,7 +748,7 @@ Ref<ArrayMesh> MeshInstance3D::bake_mesh_from_current_skeleton_pose(Ref<ArrayMes
|
|||
|
||||
const Array &source_mesh_arrays = source_mesh->surface_get_arrays(surface_index);
|
||||
|
||||
ERR_FAIL_COND_V(source_mesh_arrays.size() != RS::ARRAY_MAX, Ref<ArrayMesh>());
|
||||
ERR_FAIL_COND_V(source_mesh_arrays.size() != RSE::ARRAY_MAX, Ref<ArrayMesh>());
|
||||
|
||||
const Vector<Vector3> &source_mesh_vertex_array = source_mesh_arrays[Mesh::ARRAY_VERTEX];
|
||||
const Vector<Vector3> &source_mesh_normal_array = source_mesh_arrays[Mesh::ARRAY_NORMAL];
|
||||
|
|
@ -924,13 +933,21 @@ void MeshInstance3D::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("bake_mesh_from_current_blend_shape_mix", "existing"), &MeshInstance3D::bake_mesh_from_current_blend_shape_mix, DEFVAL(Ref<ArrayMesh>()));
|
||||
ClassDB::bind_method(D_METHOD("bake_mesh_from_current_skeleton_pose", "existing"), &MeshInstance3D::bake_mesh_from_current_skeleton_pose, DEFVAL(Ref<ArrayMesh>()));
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "mesh", PROPERTY_HINT_RESOURCE_TYPE, "Mesh"), "set_mesh", "get_mesh");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "mesh", PROPERTY_HINT_RESOURCE_TYPE, Mesh::get_class_static()), "set_mesh", "get_mesh");
|
||||
ADD_GROUP("Skeleton", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "skin", PROPERTY_HINT_RESOURCE_TYPE, "Skin"), "set_skin", "get_skin");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "skin", PROPERTY_HINT_RESOURCE_TYPE, Skin::get_class_static()), "set_skin", "get_skin");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "skeleton", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Skeleton3D"), "set_skeleton_path", "get_skeleton_path");
|
||||
ADD_GROUP("", "");
|
||||
}
|
||||
|
||||
PackedStringArray MeshInstance3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = GeometryInstance3D::get_configuration_warnings();
|
||||
if (mesh.is_null()) {
|
||||
warnings.push_back(RTR("MeshInstance3D requires a Mesh to render anything. Please add a mesh resource for it!"));
|
||||
}
|
||||
return warnings;
|
||||
}
|
||||
|
||||
MeshInstance3D::MeshInstance3D() {
|
||||
_define_ancestry(AncestralClass::MESH_INSTANCE_3D);
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
|
|
@ -939,6 +956,3 @@ MeshInstance3D::MeshInstance3D() {
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
MeshInstance3D::~MeshInstance3D() {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue