summaryrefslogtreecommitdiff
path: root/servers/physics/physics_server_sw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/physics/physics_server_sw.cpp')
-rw-r--r--servers/physics/physics_server_sw.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp
index cfe5a73ce1..521ffae0ea 100644
--- a/servers/physics/physics_server_sw.cpp
+++ b/servers/physics/physics_server_sw.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -394,6 +394,14 @@ Transform PhysicsServerSW::area_get_transform(RID p_area) const {
return area->get_transform();
};
+void PhysicsServerSW::area_set_monitorable(RID p_area,bool p_monitorable) {
+
+ AreaSW *area = area_owner.get(p_area);
+ ERR_FAIL_COND(!area);
+
+ area->set_monitorable(p_monitorable);
+}
+
void PhysicsServerSW::area_set_monitor_callback(RID p_area,Object *p_receiver,const StringName& p_method) {
AreaSW *area = area_owner.get(p_area);
@@ -423,6 +431,14 @@ bool PhysicsServerSW::area_is_ray_pickable(RID p_area) const{
}
+void PhysicsServerSW::area_set_area_monitor_callback(RID p_area,Object *p_receiver,const StringName& p_method) {
+
+
+ AreaSW *area = area_owner.get(p_area);
+ ERR_FAIL_COND(!area);
+
+ area->set_area_monitor_callback(p_receiver?p_receiver->get_instance_ID():0,p_method);
+}
/* BODY API */
@@ -551,7 +567,7 @@ bool PhysicsServerSW::body_is_shape_set_as_trigger(RID p_body, int p_shape_idx)
ERR_FAIL_COND_V(!body,false);
ERR_FAIL_INDEX_V(p_shape_idx,body->get_shape_count(),false);
- body->is_shape_set_as_trigger(p_shape_idx);
+ return body->is_shape_set_as_trigger(p_shape_idx);
}
@@ -604,6 +620,7 @@ void PhysicsServerSW::body_set_layer_mask(RID p_body, uint32_t p_mask) {
ERR_FAIL_COND(!body);
body->set_layer_mask(p_mask);
+ body->wakeup();
}
@@ -674,6 +691,7 @@ void PhysicsServerSW::body_set_state(RID p_body, BodyState p_state, const Varian
ERR_FAIL_COND(!body);
body->set_state(p_state,p_variant);
+
};
Variant PhysicsServerSW::body_get_state(RID p_body, BodyState p_state) const {
@@ -691,6 +709,7 @@ void PhysicsServerSW::body_set_applied_force(RID p_body, const Vector3& p_force)
ERR_FAIL_COND(!body);
body->set_applied_force(p_force);
+ body->wakeup();
};
Vector3 PhysicsServerSW::body_get_applied_force(RID p_body) const {
@@ -706,6 +725,7 @@ void PhysicsServerSW::body_set_applied_torque(RID p_body, const Vector3& p_torqu
ERR_FAIL_COND(!body);
body->set_applied_torque(p_torque);
+ body->wakeup();
};
Vector3 PhysicsServerSW::body_get_applied_torque(RID p_body) const {
@@ -722,6 +742,7 @@ void PhysicsServerSW::body_apply_impulse(RID p_body, const Vector3& p_pos, const
ERR_FAIL_COND(!body);
body->apply_impulse(p_pos,p_impulse);
+ body->wakeup();
};
void PhysicsServerSW::body_set_axis_velocity(RID p_body, const Vector3& p_axis_velocity) {
@@ -734,6 +755,7 @@ void PhysicsServerSW::body_set_axis_velocity(RID p_body, const Vector3& p_axis_v
v-=axis*axis.dot(v);
v+=p_axis_velocity;
body->set_linear_velocity(v);
+ body->wakeup();
};
@@ -743,6 +765,7 @@ void PhysicsServerSW::body_set_axis_lock(RID p_body,BodyAxisLock p_lock) {
BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
body->set_axis_lock(p_lock);
+ body->wakeup();
}
@@ -762,6 +785,7 @@ void PhysicsServerSW::body_add_collision_exception(RID p_body, RID p_body_b) {
ERR_FAIL_COND(!body);
body->add_exception(p_body_b);
+ body->wakeup();
};
@@ -771,6 +795,7 @@ void PhysicsServerSW::body_remove_collision_exception(RID p_body, RID p_body_b)
ERR_FAIL_COND(!body);
body->remove_exception(p_body_b);
+ body->wakeup();
};