diff options
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/SCsub | 3 | ||||
-rw-r--r-- | scene/3d/light.cpp | 6 | ||||
-rw-r--r-- | scene/3d/ray_cast.cpp | 18 | ||||
-rw-r--r-- | scene/3d/ray_cast.h | 3 |
4 files changed, 24 insertions, 6 deletions
diff --git a/scene/3d/SCsub b/scene/3d/SCsub index 72739b527e..4008f4f196 100644 --- a/scene/3d/SCsub +++ b/scene/3d/SCsub @@ -7,6 +7,9 @@ if env['disable_3d']: env.scene_sources.append("3d/spatial.cpp") env.scene_sources.append("3d/skeleton.cpp") + env.scene_sources.append("3d/particles.cpp") + env.scene_sources.append("3d/visual_instance.cpp") + env.scene_sources.append("3d/scenario_fx.cpp") else: env.add_source_files(env.scene_sources, "*.cpp") diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index e994f4c79e..02d10523e7 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -369,12 +369,6 @@ DirectionalLight::DirectionalLight() set_shadow_depth_range(SHADOW_DEPTH_RANGE_STABLE); blend_splits = false; - -#ifdef TOOLS_ENABLED - if (Engine::get_singleton()->is_editor_hint()) - // Create light with a default natural "sun" orientation in editor, instead of looking horizontally on X - set_rotation_in_degrees(Vector3(-50, 25, 30)); -#endif } void OmniLight::set_shadow_mode(ShadowMode p_mode) { diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index 296bddf0a3..9f61cc64ea 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -63,6 +63,21 @@ void RayCast::set_type_mask(uint32_t p_mask) { type_mask = p_mask; } +void RayCast::set_collision_mask_bit(int p_bit, bool p_value) { + + uint32_t mask = get_collision_mask(); + if (p_value) + mask |= 1 << p_bit; + else + mask &= ~(1 << p_bit); + set_collision_mask(mask); +} + +bool RayCast::get_collision_mask_bit(int p_bit) const { + + return get_collision_mask() & (1 << p_bit); +} + uint32_t RayCast::get_type_mask() const { return type_mask; @@ -248,6 +263,9 @@ void RayCast::_bind_methods() { ClassDB::bind_method(D_METHOD("set_collision_mask", "mask"), &RayCast::set_collision_mask); ClassDB::bind_method(D_METHOD("get_collision_mask"), &RayCast::get_collision_mask); + ClassDB::bind_method(D_METHOD("set_collision_mask_bit", "bit", "value"), &RayCast::set_collision_mask_bit); + ClassDB::bind_method(D_METHOD("get_collision_mask_bit", "bit"), &RayCast::get_collision_mask_bit); + ClassDB::bind_method(D_METHOD("set_type_mask", "mask"), &RayCast::set_type_mask); ClassDB::bind_method(D_METHOD("get_type_mask"), &RayCast::get_type_mask); diff --git a/scene/3d/ray_cast.h b/scene/3d/ray_cast.h index cd3cf3c913..cac1596264 100644 --- a/scene/3d/ray_cast.h +++ b/scene/3d/ray_cast.h @@ -72,6 +72,9 @@ public: void set_collision_mask(uint32_t p_mask); uint32_t get_collision_mask() const; + void set_collision_mask_bit(int p_bit, bool p_value); + bool get_collision_mask_bit(int p_bit) const; + void set_type_mask(uint32_t p_mask); uint32_t get_type_mask() const; |