mirror of
https://github.com/godotengine/godot.git
synced 2025-10-22 01:13:39 +00:00
Little Bits
-=-=-=-=-=- -Fixed small bugs all around -Added ability to show/hide entire sections of the spatial (3D) tree -WIP new vehicle (not ready yet) based on Bullet
This commit is contained in:
parent
c3e1d7b7c7
commit
2ee4ac183b
56 changed files with 3943 additions and 1757 deletions
|
@ -195,6 +195,7 @@ void GeometryInstance::_notification(int p_what) {
|
|||
_find_baked_light();
|
||||
}
|
||||
|
||||
_update_visibility();
|
||||
|
||||
} else if (p_what==NOTIFICATION_EXIT_WORLD) {
|
||||
|
||||
|
@ -207,8 +208,13 @@ void GeometryInstance::_notification(int p_what) {
|
|||
_baked_light_changed();
|
||||
|
||||
}
|
||||
|
||||
} if (p_what==NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
|
||||
_update_visibility();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void GeometryInstance::_baked_light_changed() {
|
||||
|
@ -241,6 +247,15 @@ void GeometryInstance::_find_baked_light() {
|
|||
_baked_light_changed();
|
||||
}
|
||||
|
||||
void GeometryInstance::_update_visibility() {
|
||||
|
||||
if (!is_inside_scene())
|
||||
return;
|
||||
|
||||
_change_notify("geometry/visible");
|
||||
VS::get_singleton()->instance_geometry_set_flag(get_instance(),VS::INSTANCE_FLAG_VISIBLE,is_visible() && flags[FLAG_VISIBLE]);
|
||||
}
|
||||
|
||||
void GeometryInstance::set_flag(Flags p_flag,bool p_value) {
|
||||
|
||||
ERR_FAIL_INDEX(p_flag,FLAG_MAX);
|
||||
|
@ -250,8 +265,7 @@ void GeometryInstance::set_flag(Flags p_flag,bool p_value) {
|
|||
flags[p_flag]=p_value;
|
||||
VS::get_singleton()->instance_geometry_set_flag(get_instance(),(VS::InstanceFlags)p_flag,p_value);
|
||||
if (p_flag==FLAG_VISIBLE) {
|
||||
_change_notify("geometry/visible");
|
||||
emit_signal(SceneStringNames::get_singleton()->visibility_changed);
|
||||
_update_visibility();
|
||||
}
|
||||
if (p_flag==FLAG_USE_BAKED_LIGHT) {
|
||||
|
||||
|
@ -321,7 +335,7 @@ void GeometryInstance::_bind_methods() {
|
|||
ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "geometry/use_baked_light"), _SCS("set_flag"), _SCS("get_flag"),FLAG_USE_BAKED_LIGHT);
|
||||
ADD_PROPERTY( PropertyInfo( Variant::INT, "geometry/baked_light_tex_id"), _SCS("set_baked_light_texture_id"), _SCS("get_baked_light_texture_id"));
|
||||
|
||||
ADD_SIGNAL( MethodInfo("visibility_changed"));
|
||||
// ADD_SIGNAL( MethodInfo("visibility_changed"));
|
||||
|
||||
BIND_CONSTANT(FLAG_VISIBLE );
|
||||
BIND_CONSTANT(FLAG_CAST_SHADOW );
|
||||
|
@ -346,6 +360,7 @@ GeometryInstance::GeometryInstance() {
|
|||
flags[FLAG_VISIBLE_IN_ALL_ROOMS]=false;
|
||||
baked_light_instance=NULL;
|
||||
baked_light_texture_id=0;
|
||||
VS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),0);
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue