3535#include " servers/audio_server.h"
3636
3737void Area3D::set_gravity_space_override_mode (SpaceOverride p_mode) {
38+ if (gravity_space_override == p_mode) return ;
3839 gravity_space_override = p_mode;
3940 PhysicsServer3D::get_singleton ()->area_set_param (get_rid (), PhysicsServer3D::AREA_PARAM_GRAVITY_OVERRIDE_MODE, p_mode);
4041}
@@ -44,6 +45,7 @@ Area3D::SpaceOverride Area3D::get_gravity_space_override_mode() const {
4445}
4546
4647void Area3D::set_gravity_is_point (bool p_enabled) {
48+ if (gravity_is_point == p_enabled) return ;
4749 gravity_is_point = p_enabled;
4850 PhysicsServer3D::get_singleton ()->area_set_param (get_rid (), PhysicsServer3D::AREA_PARAM_GRAVITY_IS_POINT, p_enabled);
4951}
@@ -53,6 +55,7 @@ bool Area3D::is_gravity_a_point() const {
5355}
5456
5557void Area3D::set_gravity_point_unit_distance (real_t p_scale) {
58+ if (gravity_point_unit_distance == p_scale) return ;
5659 gravity_point_unit_distance = p_scale;
5760 PhysicsServer3D::get_singleton ()->area_set_param (get_rid (), PhysicsServer3D::AREA_PARAM_GRAVITY_POINT_UNIT_DISTANCE, p_scale);
5861}
@@ -62,6 +65,7 @@ real_t Area3D::get_gravity_point_unit_distance() const {
6265}
6366
6467void Area3D::set_gravity_point_center (const Vector3 &p_center) {
68+ if (gravity_vec == p_center) return ;
6569 gravity_vec = p_center;
6670 PhysicsServer3D::get_singleton ()->area_set_param (get_rid (), PhysicsServer3D::AREA_PARAM_GRAVITY_VECTOR, p_center);
6771}
@@ -71,6 +75,7 @@ const Vector3 &Area3D::get_gravity_point_center() const {
7175}
7276
7377void Area3D::set_gravity_direction (const Vector3 &p_direction) {
78+ if (gravity_vec == p_direction) return ;
7479 gravity_vec = p_direction;
7580 PhysicsServer3D::get_singleton ()->area_set_param (get_rid (), PhysicsServer3D::AREA_PARAM_GRAVITY_VECTOR, p_direction);
7681}
@@ -80,6 +85,7 @@ const Vector3 &Area3D::get_gravity_direction() const {
8085}
8186
8287void Area3D::set_gravity (real_t p_gravity) {
88+ if (gravity == p_gravity) return ;
8389 gravity = p_gravity;
8490 PhysicsServer3D::get_singleton ()->area_set_param (get_rid (), PhysicsServer3D::AREA_PARAM_GRAVITY, p_gravity);
8591}
@@ -89,6 +95,7 @@ real_t Area3D::get_gravity() const {
8995}
9096
9197void Area3D::set_linear_damp_space_override_mode (SpaceOverride p_mode) {
98+ if (linear_damp_space_override == p_mode) return ;
9299 linear_damp_space_override = p_mode;
93100 PhysicsServer3D::get_singleton ()->area_set_param (get_rid (), PhysicsServer3D::AREA_PARAM_LINEAR_DAMP_OVERRIDE_MODE, p_mode);
94101}
@@ -98,6 +105,7 @@ Area3D::SpaceOverride Area3D::get_linear_damp_space_override_mode() const {
98105}
99106
100107void Area3D::set_angular_damp_space_override_mode (SpaceOverride p_mode) {
108+ if (angular_damp_space_override == p_mode) return ;
101109 angular_damp_space_override = p_mode;
102110 PhysicsServer3D::get_singleton ()->area_set_param (get_rid (), PhysicsServer3D::AREA_PARAM_ANGULAR_DAMP_OVERRIDE_MODE, p_mode);
103111}
@@ -107,6 +115,7 @@ Area3D::SpaceOverride Area3D::get_angular_damp_space_override_mode() const {
107115}
108116
109117void Area3D::set_linear_damp (real_t p_linear_damp) {
118+ if (linear_damp == p_linear_damp) return ;
110119 linear_damp = p_linear_damp;
111120 PhysicsServer3D::get_singleton ()->area_set_param (get_rid (), PhysicsServer3D::AREA_PARAM_LINEAR_DAMP, p_linear_damp);
112121}
@@ -116,6 +125,7 @@ real_t Area3D::get_linear_damp() const {
116125}
117126
118127void Area3D::set_angular_damp (real_t p_angular_damp) {
128+ if (angular_damp == p_angular_damp) return ;
119129 angular_damp = p_angular_damp;
120130 PhysicsServer3D::get_singleton ()->area_set_param (get_rid (), PhysicsServer3D::AREA_PARAM_ANGULAR_DAMP, p_angular_damp);
121131}
@@ -125,6 +135,7 @@ real_t Area3D::get_angular_damp() const {
125135}
126136
127137void Area3D::set_priority (int p_priority) {
138+ if (priority == p_priority) return ;
128139 priority = p_priority;
129140 PhysicsServer3D::get_singleton ()->area_set_param (get_rid (), PhysicsServer3D::AREA_PARAM_PRIORITY, p_priority);
130141}
@@ -134,6 +145,7 @@ int Area3D::get_priority() const {
134145}
135146
136147void Area3D::set_wind_force_magnitude (real_t p_wind_force_magnitude) {
148+ if (wind_force_magnitude == p_wind_force_magnitude) return ;
137149 wind_force_magnitude = p_wind_force_magnitude;
138150 if (is_inside_tree ()) {
139151 _initialize_wind ();
@@ -145,6 +157,7 @@ real_t Area3D::get_wind_force_magnitude() const {
145157}
146158
147159void Area3D::set_wind_attenuation_factor (real_t p_wind_force_attenuation_factor) {
160+ if (wind_attenuation_factor == p_wind_force_attenuation_factor) return ;
148161 wind_attenuation_factor = p_wind_force_attenuation_factor;
149162 if (is_inside_tree ()) {
150163 _initialize_wind ();
@@ -156,6 +169,7 @@ real_t Area3D::get_wind_attenuation_factor() const {
156169}
157170
158171void Area3D::set_wind_source_path (const NodePath &p_wind_source_path) {
172+ if (wind_source_path == p_wind_source_path) return ;
159173 wind_source_path = p_wind_source_path;
160174 if (is_inside_tree ()) {
161175 _initialize_wind ();
0 commit comments