summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/SCsub4
-rw-r--r--scene/3d/audio_stream_player_3d.cpp4
-rw-r--r--scene/3d/baked_lightmap.cpp2
-rw-r--r--scene/3d/cpu_particles.cpp4
-rw-r--r--scene/3d/light.cpp6
-rw-r--r--scene/3d/navigation.cpp4
-rw-r--r--scene/3d/physics_body.cpp8
-rw-r--r--scene/3d/physics_body.h2
-rw-r--r--scene/3d/spring_arm.cpp3
-rw-r--r--scene/3d/spring_arm.h2
-rw-r--r--scene/3d/visibility_notifier.h2
-rw-r--r--scene/3d/voxel_light_baker.cpp7
-rw-r--r--scene/3d/voxel_light_baker.h10
13 files changed, 35 insertions, 23 deletions
diff --git a/scene/3d/SCsub b/scene/3d/SCsub
index 4008f4f196..35cc7479d8 100644
--- a/scene/3d/SCsub
+++ b/scene/3d/SCsub
@@ -2,9 +2,7 @@
Import('env')
-
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")
@@ -12,5 +10,3 @@ if env['disable_3d']:
env.scene_sources.append("3d/scenario_fx.cpp")
else:
env.add_source_files(env.scene_sources, "*.cpp")
-
-Export('env')
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index 386f2a4348..abf022ecb3 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -417,7 +417,7 @@ void AudioStreamPlayer3D::_notification(int p_what) {
}
}
- for (int k = 0; k < cc; k++) {
+ for (unsigned int k = 0; k < cc; k++) {
output.vol[k] *= multiplier;
}
@@ -814,7 +814,7 @@ AudioStreamPlayer3D::AttenuationModel AudioStreamPlayer3D::get_attenuation_model
void AudioStreamPlayer3D::set_out_of_range_mode(OutOfRangeMode p_mode) {
- ERR_FAIL_INDEX(p_mode, 2);
+ ERR_FAIL_INDEX((int)p_mode, 2);
out_of_range_mode = p_mode;
}
diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp
index c58e318651..8f3fe8577e 100644
--- a/scene/3d/baked_lightmap.cpp
+++ b/scene/3d/baked_lightmap.cpp
@@ -365,7 +365,7 @@ BakedLightmap::BakeError BakedLightmap::bake(Node *p_from_node, bool p_create_vi
{
bake_bounds = AABB(-extents, extents * 2.0);
int subdiv = nearest_power_of_2_templated(int(bake_bounds.get_longest_axis_size() / bake_cell_size));
- bake_bounds.size[bake_bounds.get_longest_axis_size()] = subdiv * bake_cell_size;
+ bake_bounds.size[bake_bounds.get_longest_axis_index()] = subdiv * bake_cell_size;
bake_subdiv = nearest_shift(subdiv) + 1;
capture_subdiv = bake_subdiv;
diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp
index 712f0ba78b..ec51c31674 100644
--- a/scene/3d/cpu_particles.cpp
+++ b/scene/3d/cpu_particles.cpp
@@ -471,10 +471,6 @@ static float rand_from_seed(uint32_t &seed) {
return float(seed % uint32_t(65536)) / 65535.0;
}
-static float rand_from_seed_m1_p1(uint32_t &seed) {
- return rand_from_seed(seed) * 2.0 - 1.0;
-}
-
void CPUParticles::_particles_process(float p_delta) {
p_delta *= speed_scale;
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp
index d674958d33..7e1d60ab8e 100644
--- a/scene/3d/light.cpp
+++ b/scene/3d/light.cpp
@@ -163,6 +163,11 @@ void Light::_update_visibility() {
if (!is_inside_tree())
return;
+ // FIXME: Since the call to VS::instance_light_set_enabled was disabled below,
+ // the whole logic became pointless so editor_ok triggers unused variable warnings.
+ // Commenting out for now but this should be fixed/reimplemented so that editor_only
+ // works as expected (GH-17989).
+ /*
bool editor_ok = true;
#ifdef TOOLS_ENABLED
@@ -180,6 +185,7 @@ void Light::_update_visibility() {
#endif
//VS::get_singleton()->instance_light_set_enabled(get_instance(),is_visible_in_tree() && editor_ok);
+ */
_change_notify("geometry/visible");
}
diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp
index 54f74c2df3..6e7b372647 100644
--- a/scene/3d/navigation.cpp
+++ b/scene/3d/navigation.cpp
@@ -563,7 +563,6 @@ Vector3 Navigation::get_closest_point_to_segment(const Vector3 &p_from, const Ve
bool use_collision = p_use_collision;
Vector3 closest_point;
float closest_point_d = 1e20;
- NavMesh *closest_navmesh = NULL;
for (Map<int, NavMesh>::Element *E = navmesh_map.front(); E; E = E->next()) {
@@ -582,12 +581,10 @@ Vector3 Navigation::get_closest_point_to_segment(const Vector3 &p_from, const Ve
closest_point = inters;
use_collision = true;
closest_point_d = p_from.distance_to(inters);
- closest_navmesh = p.owner;
} else if (closest_point_d > inters.distance_to(p_from)) {
closest_point = inters;
closest_point_d = p_from.distance_to(inters);
- closest_navmesh = p.owner;
}
}
}
@@ -605,7 +602,6 @@ Vector3 Navigation::get_closest_point_to_segment(const Vector3 &p_from, const Ve
closest_point_d = d;
closest_point = b;
- closest_navmesh = p.owner;
}
}
}
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index d7bd89625f..0fb0869979 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -2287,6 +2287,8 @@ void PhysicalBone::_reload_joint() {
}
} break;
+ case JOINT_TYPE_NONE: {
+ } break;
}
}
@@ -2342,6 +2344,8 @@ void PhysicalBone::set_joint_type(JointType p_joint_type) {
case JOINT_TYPE_6DOF:
joint_data = memnew(SixDOFJointData);
break;
+ case JOINT_TYPE_NONE:
+ break;
}
_reload_joint();
@@ -2505,12 +2509,12 @@ PhysicalBone::PhysicalBone() :
gizmo_move_joint(false),
#endif
joint_data(NULL),
+ parent_skeleton(NULL),
static_body(false),
- simulate_physics(false),
_internal_static_body(false),
+ simulate_physics(false),
_internal_simulate_physics(false),
bone_id(-1),
- parent_skeleton(NULL),
bone_name(""),
bounce(0),
mass(1),
diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h
index ca48b51ffb..ed9f41197b 100644
--- a/scene/3d/physics_body.h
+++ b/scene/3d/physics_body.h
@@ -389,6 +389,8 @@ public:
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
virtual bool _get(const StringName &p_name, Variant &r_ret) const;
virtual void _get_property_list(List<PropertyInfo> *p_list) const;
+
+ virtual ~JointData() {}
};
struct PinJointData : public JointData {
diff --git a/scene/3d/spring_arm.cpp b/scene/3d/spring_arm.cpp
index 818e7f9217..f74784c2f9 100644
--- a/scene/3d/spring_arm.cpp
+++ b/scene/3d/spring_arm.cpp
@@ -36,8 +36,9 @@
SpringArm::SpringArm() :
spring_length(1),
- mask(1),
current_spring_length(0),
+ keep_child_basis(false),
+ mask(1),
margin(0.01) {}
void SpringArm::_notification(int p_what) {
diff --git a/scene/3d/spring_arm.h b/scene/3d/spring_arm.h
index 24d912d371..e0c3f2992d 100644
--- a/scene/3d/spring_arm.h
+++ b/scene/3d/spring_arm.h
@@ -39,8 +39,8 @@ class SpringArm : public Spatial {
Ref<Shape> shape;
Set<RID> excluded_objects;
float spring_length;
- bool keep_child_basis;
float current_spring_length;
+ bool keep_child_basis;
uint32_t mask;
float margin;
diff --git a/scene/3d/visibility_notifier.h b/scene/3d/visibility_notifier.h
index b1985f4a0c..2cf685a92c 100644
--- a/scene/3d/visibility_notifier.h
+++ b/scene/3d/visibility_notifier.h
@@ -48,7 +48,7 @@ protected:
void _notification(int p_what);
static void _bind_methods();
- friend class SpatialIndexer;
+ friend struct SpatialIndexer;
void _enter_camera(Camera *p_camera);
void _exit_camera(Camera *p_camera);
diff --git a/scene/3d/voxel_light_baker.cpp b/scene/3d/voxel_light_baker.cpp
index 651a057392..5580cabe30 100644
--- a/scene/3d/voxel_light_baker.cpp
+++ b/scene/3d/voxel_light_baker.cpp
@@ -734,7 +734,8 @@ void VoxelLightBaker::_check_init_light() {
leaf_voxel_count = 0;
_fixup_plot(0, 0); //pre fixup, so normal, albedo, emission, etc. work for lighting.
bake_light.resize(bake_cells.size());
- zeromem(bake_light.ptrw(), bake_light.size() * sizeof(Light));
+ print_line("bake light size: " + itos(bake_light.size()));
+ //zeromem(bake_light.ptrw(), bake_light.size() * sizeof(Light));
first_leaf = -1;
_init_light_plot(0, 0, 0, 0, 0, CHILD_EMPTY);
}
@@ -1588,8 +1589,8 @@ Vector3 VoxelLightBaker::_compute_pixel_light_at_pos(const Vector3 &p_pos, const
const Vector3 *cone_dirs;
const float *cone_weights;
- int cone_dir_count;
- float cone_aperture;
+ int cone_dir_count = 0;
+ float cone_aperture = 0;
switch (bake_quality) {
case BAKE_QUALITY_LOW: {
diff --git a/scene/3d/voxel_light_baker.h b/scene/3d/voxel_light_baker.h
index 6a1f1253a3..3d55c053f3 100644
--- a/scene/3d/voxel_light_baker.h
+++ b/scene/3d/voxel_light_baker.h
@@ -92,6 +92,16 @@ private:
float accum[6][3]; //rgb anisotropic
float direct_accum[6][3]; //for direct bake
int next_leaf;
+ Light() {
+ x = y = z = 0;
+ for (int i = 0; i < 6; i++) {
+ for (int j = 0; j < 3; j++) {
+ accum[i][j] = 0;
+ direct_accum[i][j] = 0;
+ }
+ }
+ next_leaf = 0;
+ }
};
int first_leaf;