summaryrefslogtreecommitdiff
path: root/servers/physics_2d/area_2d_sw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/physics_2d/area_2d_sw.cpp')
-rw-r--r--servers/physics_2d/area_2d_sw.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/servers/physics_2d/area_2d_sw.cpp b/servers/physics_2d/area_2d_sw.cpp
index 45666d9d09..85ec2aae47 100644
--- a/servers/physics_2d/area_2d_sw.cpp
+++ b/servers/physics_2d/area_2d_sw.cpp
@@ -117,40 +117,40 @@ void Area2DSW::set_area_monitor_callback(ObjectID p_id, const StringName &p_meth
get_space()->area_add_to_moved_list(&moved_list);
}
-void Area2DSW::set_space_override_mode(Physics2DServer::AreaSpaceOverrideMode p_mode) {
- bool do_override = p_mode != Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED;
- if (do_override == (space_override_mode != Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED))
+void Area2DSW::set_space_override_mode(PhysicsServer2D::AreaSpaceOverrideMode p_mode) {
+ bool do_override = p_mode != PhysicsServer2D::AREA_SPACE_OVERRIDE_DISABLED;
+ if (do_override == (space_override_mode != PhysicsServer2D::AREA_SPACE_OVERRIDE_DISABLED))
return;
_unregister_shapes();
space_override_mode = p_mode;
_shape_changed();
}
-void Area2DSW::set_param(Physics2DServer::AreaParameter p_param, const Variant &p_value) {
+void Area2DSW::set_param(PhysicsServer2D::AreaParameter p_param, const Variant &p_value) {
switch (p_param) {
- case Physics2DServer::AREA_PARAM_GRAVITY: gravity = p_value; break;
- case Physics2DServer::AREA_PARAM_GRAVITY_VECTOR: gravity_vector = p_value; break;
- case Physics2DServer::AREA_PARAM_GRAVITY_IS_POINT: gravity_is_point = p_value; break;
- case Physics2DServer::AREA_PARAM_GRAVITY_DISTANCE_SCALE: gravity_distance_scale = p_value; break;
- case Physics2DServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION: point_attenuation = p_value; break;
- case Physics2DServer::AREA_PARAM_LINEAR_DAMP: linear_damp = p_value; break;
- case Physics2DServer::AREA_PARAM_ANGULAR_DAMP: angular_damp = p_value; break;
- case Physics2DServer::AREA_PARAM_PRIORITY: priority = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY: gravity = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_VECTOR: gravity_vector = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_IS_POINT: gravity_is_point = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_DISTANCE_SCALE: gravity_distance_scale = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_POINT_ATTENUATION: point_attenuation = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_LINEAR_DAMP: linear_damp = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_ANGULAR_DAMP: angular_damp = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_PRIORITY: priority = p_value; break;
}
}
-Variant Area2DSW::get_param(Physics2DServer::AreaParameter p_param) const {
+Variant Area2DSW::get_param(PhysicsServer2D::AreaParameter p_param) const {
switch (p_param) {
- case Physics2DServer::AREA_PARAM_GRAVITY: return gravity;
- case Physics2DServer::AREA_PARAM_GRAVITY_VECTOR: return gravity_vector;
- case Physics2DServer::AREA_PARAM_GRAVITY_IS_POINT: return gravity_is_point;
- case Physics2DServer::AREA_PARAM_GRAVITY_DISTANCE_SCALE: return gravity_distance_scale;
- case Physics2DServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION: return point_attenuation;
- case Physics2DServer::AREA_PARAM_LINEAR_DAMP: return linear_damp;
- case Physics2DServer::AREA_PARAM_ANGULAR_DAMP: return angular_damp;
- case Physics2DServer::AREA_PARAM_PRIORITY: return priority;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY: return gravity;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_VECTOR: return gravity_vector;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_IS_POINT: return gravity_is_point;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_DISTANCE_SCALE: return gravity_distance_scale;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_POINT_ATTENUATION: return point_attenuation;
+ case PhysicsServer2D::AREA_PARAM_LINEAR_DAMP: return linear_damp;
+ case PhysicsServer2D::AREA_PARAM_ANGULAR_DAMP: return angular_damp;
+ case PhysicsServer2D::AREA_PARAM_PRIORITY: return priority;
}
return Variant();
@@ -194,7 +194,7 @@ void Area2DSW::call_queries() {
if (E->get().state == 0)
continue; //nothing happened
- res[0] = E->get().state > 0 ? Physics2DServer::AREA_BODY_ADDED : Physics2DServer::AREA_BODY_REMOVED;
+ res[0] = E->get().state > 0 ? PhysicsServer2D::AREA_BODY_ADDED : PhysicsServer2D::AREA_BODY_REMOVED;
res[1] = E->key().rid;
res[2] = E->key().instance_id;
res[3] = E->key().body_shape;
@@ -226,7 +226,7 @@ void Area2DSW::call_queries() {
if (E->get().state == 0)
continue; //nothing happened
- res[0] = E->get().state > 0 ? Physics2DServer::AREA_BODY_ADDED : Physics2DServer::AREA_BODY_REMOVED;
+ res[0] = E->get().state > 0 ? PhysicsServer2D::AREA_BODY_ADDED : PhysicsServer2D::AREA_BODY_REMOVED;
res[1] = E->key().rid;
res[2] = E->key().instance_id;
res[3] = E->key().body_shape;
@@ -248,7 +248,7 @@ Area2DSW::Area2DSW() :
moved_list(this) {
_set_static(true); //areas are not active by default
- space_override_mode = Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED;
+ space_override_mode = PhysicsServer2D::AREA_SPACE_OVERRIDE_DISABLED;
gravity = 9.80665;
gravity_vector = Vector2(0, -1);
gravity_is_point = false;