Make Area physics priority consistently int and allow negative numbers

This commit is contained in:
Aaron Franke 2023-02-05 02:09:32 -06:00 committed by Yuri Sizov
parent a7276f1ce0
commit 87bd8d2dcf
6 changed files with 14 additions and 14 deletions

View file

@ -107,8 +107,8 @@
<member name="monitoring" type="bool" setter="set_monitoring" getter="is_monitoring" default="true">
If [code]true[/code], the area detects bodies or areas entering and exiting it.
</member>
<member name="priority" type="float" setter="set_priority" getter="get_priority" default="0.0">
The area's priority. Higher priority areas are processed first.
<member name="priority" type="int" setter="set_priority" getter="get_priority" default="0">
The area's priority. Higher priority areas are processed first. The [World2D]'s physics is always processed last, after all areas.
</member>
</members>
<signals>

View file

@ -106,8 +106,8 @@
<member name="monitoring" type="bool" setter="set_monitoring" getter="is_monitoring" default="true">
If [code]true[/code], the area detects bodies or areas entering and exiting it.
</member>
<member name="priority" type="float" setter="set_priority" getter="get_priority" default="0.0">
The area's priority. Higher priority areas are processed first.
<member name="priority" type="int" setter="set_priority" getter="get_priority" default="0">
The area's priority. Higher priority areas are processed first. The [World3D]'s physics is always processed last, after all areas.
</member>
<member name="reverb_bus_amount" type="float" setter="set_reverb_amount" getter="get_reverb_amount" default="0.0">
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.

View file

@ -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");

View file

@ -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;

View file

@ -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");

View file

@ -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;