diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-05-04 22:50:23 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-05-04 22:50:23 -0300 |
commit | 72ae89c5aa8da9110ec8f89e5558d5d04935f3b5 (patch) | |
tree | 453b2c8b8cc0edc588cee2dd3e440b30ff729ae2 /scene/resources/mesh.cpp | |
parent | 3c17e0c91548299b60a6d3998eadb303418512cc (diff) | |
download | redot-engine-72ae89c5aa8da9110ec8f89e5558d5d04935f3b5.tar.gz |
Lots of 3D improvements:
-Object Manipulator Gizmo keeps proper scale in all windows and projections, (configurable on settings too).
-Manipulator gizmos for other objects (camera, shapes, etc) massively improved and bug-fixed.
-Manipulator gizmos are different for edited object and other objects.
-Properly highlight manipulator gizmo handles when hovered.
-Fixed bugs in fragment program when using more than 1 light together.
-Reload png/jpg files automatically in editor if edited externally.
-Added 4-stages Parallel Split Shadow Mapping, to improve shadow quality in large scenarios
-Added PCF13 to improve smoothness of shadow borders
-General optimization of directional light shadow mapping for Orthogonal,PSM and PSSM.
-Fixed normal mapping when importing DAE files, works nicely now.
Diffstat (limited to 'scene/resources/mesh.cpp')
-rw-r--r-- | scene/resources/mesh.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 244ee09c22..6d0a1cf76b 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -99,6 +99,12 @@ bool Mesh::_set(const StringName& p_name, const Variant& p_value) { return true; } + if (sname=="custom_aabb/custom_aabb") { + + set_custom_aabb(p_value); + return true; + } + if (!sname.begins_with("surfaces")) return false; @@ -165,6 +171,10 @@ bool Mesh::_get(const StringName& p_name,Variant &r_ret) const { int idx=sname.get_slice("/",1).to_int()-1; r_ret=surface_get_material(idx); return true; + } else if (sname=="custom_aabb/custom_aabb") { + + r_ret=custom_aabb; + return true; } else if (!sname.begins_with("surfaces")) return false; @@ -202,6 +212,9 @@ void Mesh::_get_property_list( List<PropertyInfo> *p_list) const { p_list->push_back( PropertyInfo( Variant::DICTIONARY,"surfaces/"+itos(i), PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR ) ); p_list->push_back( PropertyInfo( Variant::OBJECT,"materials/"+itos(i+1), PROPERTY_HINT_RESOURCE_TYPE,"Material",PROPERTY_USAGE_EDITOR ) ); } + + p_list->push_back( PropertyInfo( Variant::_AABB,"custom_aabb/custom_aabb" ) ); + } @@ -473,6 +486,19 @@ AABB Mesh::get_aabb() const { return aabb; } + +void Mesh::set_custom_aabb(const AABB& p_custom) { + + custom_aabb=p_custom; + VS::get_singleton()->mesh_set_custom_aabb(mesh,custom_aabb); +} + +AABB Mesh::get_custom_aabb() const { + + return custom_aabb; +} + + DVector<Face3> Mesh::get_faces() const { @@ -700,6 +726,8 @@ void Mesh::_bind_methods() { ObjectTypeDB::bind_method(_MD("center_geometry"),&Mesh::center_geometry); ObjectTypeDB::set_method_flags(get_type_static(),_SCS("center_geometry"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ObjectTypeDB::bind_method(_MD("set_custom_aabb","aabb"),&Mesh::set_custom_aabb); + ObjectTypeDB::bind_method(_MD("get_custom_aabb"),&Mesh::get_custom_aabb); BIND_CONSTANT( NO_INDEX_ARRAY ); |