diff options
author | yg2f <yoann@terminajones.com> | 2016-09-22 23:01:44 +0200 |
---|---|---|
committer | yg2f <yoann@terminajones.com> | 2016-09-22 23:06:07 +0200 |
commit | c1e23589143e8372612b906d0e09bb8bd6b48546 (patch) | |
tree | ef6587480d7b44eb25ea3b5d2ab06fa77cd377b0 /scene/3d | |
parent | 53c1c7ff8f062529bcdceabd62416c6f483ca523 (diff) |
expose GeometryInstance.get_aabb() etc fixes #6587
expose ``GeometryInstance.get_aabb();`` to gdscript
expose ``VisualInstance.get_transformed_aabb();`` to gdscript
and debug ``ImmediateGeometry::add_vertex()``;
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/immediate_geometry.cpp | 1 | ||||
-rw-r--r-- | scene/3d/visual_instance.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp index c9319904bd..99c7fd047f 100644 --- a/scene/3d/immediate_geometry.cpp +++ b/scene/3d/immediate_geometry.cpp @@ -72,6 +72,7 @@ void ImmediateGeometry::add_vertex(const Vector3& p_vertex){ if (empty) { aabb.pos=p_vertex; aabb.size=Vector3(); + empty=false; } else { aabb.expand_to(p_vertex); } diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index b15226cce3..b4f7a4e5b4 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -128,6 +128,8 @@ void VisualInstance::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_layer_mask","mask"), &VisualInstance::set_layer_mask); ObjectTypeDB::bind_method(_MD("get_layer_mask"), &VisualInstance::get_layer_mask); + ObjectTypeDB::bind_method(_MD("get_transformed_aabb"), &VisualInstance::get_transformed_aabb); + ADD_PROPERTY( PropertyInfo( Variant::INT, "layers",PROPERTY_HINT_ALL_FLAGS), _SCS("set_layer_mask"), _SCS("get_layer_mask")); @@ -376,6 +378,8 @@ void GeometryInstance::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_extra_cull_margin","margin"), &GeometryInstance::set_extra_cull_margin); ObjectTypeDB::bind_method(_MD("get_extra_cull_margin"), &GeometryInstance::get_extra_cull_margin); + ObjectTypeDB::bind_method(_MD("get_aabb"),&GeometryInstance::get_aabb); + ObjectTypeDB::bind_method(_MD("_baked_light_changed"), &GeometryInstance::_baked_light_changed); ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "geometry/visible"), _SCS("set_flag"), _SCS("get_flag"),FLAG_VISIBLE); |