diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index b7d311d8270..e197e7d04db 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -107,8 +107,8 @@ If [code]true[/code], the area detects bodies or areas entering and exiting it. - - The area's priority. Higher priority areas are processed first. + + The area's priority. Higher priority areas are processed first. The [World2D]'s physics is always processed last, after all areas. diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml index 38d7519f732..62397c146ee 100644 --- a/doc/classes/Area3D.xml +++ b/doc/classes/Area3D.xml @@ -106,8 +106,8 @@ If [code]true[/code], the area detects bodies or areas entering and exiting it. - - The area's priority. Higher priority areas are processed first. + + The area's priority. Higher priority areas are processed first. The [World3D]'s physics is always processed last, after all areas. The degree to which this area applies reverb to its associated audio. Ranges from [code]0[/code] to [code]1[/code] with [code]0.1[/code] precision. diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index a37fabf21f2..84877b13c22 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -123,12 +123,12 @@ real_t Area2D::get_angular_damp() const { return angular_damp; } -void Area2D::set_priority(real_t p_priority) { +void Area2D::set_priority(int p_priority) { priority = p_priority; PhysicsServer2D::get_singleton()->area_set_param(get_rid(), PhysicsServer2D::AREA_PARAM_PRIORITY, p_priority); } -real_t Area2D::get_priority() const { +int Area2D::get_priority() const { return priority; } @@ -617,7 +617,7 @@ void Area2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitoring"), "set_monitoring", "is_monitoring"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitorable"), "set_monitorable", "is_monitorable"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,128,1"), "set_priority", "get_priority"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,100000,1,or_greater,or_less"), "set_priority", "get_priority"); ADD_GROUP("Gravity", "gravity_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "gravity_space_override", PROPERTY_HINT_ENUM, "Disabled,Combine,Combine-Replace,Replace,Replace-Combine", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "set_gravity_space_override_mode", "get_gravity_space_override_mode"); diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h index 8f4bbe32192..421c29f7589 100644 --- a/scene/2d/area_2d.h +++ b/scene/2d/area_2d.h @@ -168,8 +168,8 @@ public: void set_angular_damp(real_t p_angular_damp); real_t get_angular_damp() const; - void set_priority(real_t p_priority); - real_t get_priority() const; + void set_priority(int p_priority); + int get_priority() const; void set_monitoring(bool p_enable); bool is_monitoring() const; diff --git a/scene/3d/area_3d.cpp b/scene/3d/area_3d.cpp index 5901e38bb4d..47912ad261d 100644 --- a/scene/3d/area_3d.cpp +++ b/scene/3d/area_3d.cpp @@ -123,12 +123,12 @@ real_t Area3D::get_angular_damp() const { return angular_damp; } -void Area3D::set_priority(real_t p_priority) { +void Area3D::set_priority(int p_priority) { priority = p_priority; PhysicsServer3D::get_singleton()->area_set_param(get_rid(), PhysicsServer3D::AREA_PARAM_PRIORITY, p_priority); } -real_t Area3D::get_priority() const { +int Area3D::get_priority() const { return priority; } @@ -736,7 +736,7 @@ void Area3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitoring"), "set_monitoring", "is_monitoring"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitorable"), "set_monitorable", "is_monitorable"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,128,1"), "set_priority", "get_priority"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,100000,1,or_greater,or_less"), "set_priority", "get_priority"); ADD_GROUP("Gravity", "gravity_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "gravity_space_override", PROPERTY_HINT_ENUM, "Disabled,Combine,Combine-Replace,Replace,Replace-Combine", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "set_gravity_space_override_mode", "get_gravity_space_override_mode"); diff --git a/scene/3d/area_3d.h b/scene/3d/area_3d.h index 607e0d2af8a..454c8c29606 100644 --- a/scene/3d/area_3d.h +++ b/scene/3d/area_3d.h @@ -179,8 +179,8 @@ public: void set_linear_damp(real_t p_linear_damp); real_t get_linear_damp() const; - void set_priority(real_t p_priority); - real_t get_priority() const; + void set_priority(int p_priority); + int get_priority() const; void set_wind_force_magnitude(real_t p_wind_force_magnitude); real_t get_wind_force_magnitude() const;