|
@@ -354,10 +354,16 @@ public:
|
|
|
virtual real_t get_inverse_mass() const { return body->get_inv_mass(); } // get the mass
|
|
|
virtual real_t get_inverse_inertia() const { return body->get_inv_inertia(); } // get density of this body space
|
|
|
|
|
|
- virtual void set_linear_velocity(const Vector2 &p_velocity) { body->set_linear_velocity(p_velocity); }
|
|
|
+ virtual void set_linear_velocity(const Vector2 &p_velocity) {
|
|
|
+ body->wakeup();
|
|
|
+ body->set_linear_velocity(p_velocity);
|
|
|
+ }
|
|
|
virtual Vector2 get_linear_velocity() const { return body->get_linear_velocity(); }
|
|
|
|
|
|
- virtual void set_angular_velocity(real_t p_velocity) { body->set_angular_velocity(p_velocity); }
|
|
|
+ virtual void set_angular_velocity(real_t p_velocity) {
|
|
|
+ body->wakeup();
|
|
|
+ body->set_angular_velocity(p_velocity);
|
|
|
+ }
|
|
|
virtual real_t get_angular_velocity() const { return body->get_angular_velocity(); }
|
|
|
|
|
|
virtual void set_transform(const Transform2D &p_transform) { body->set_state(Physics2DServer::BODY_STATE_TRANSFORM, p_transform); }
|
|
@@ -365,12 +371,30 @@ public:
|
|
|
|
|
|
virtual Vector2 get_velocity_at_local_position(const Vector2 &p_position) const { return body->get_velocity_in_local_point(p_position); }
|
|
|
|
|
|
- virtual void add_central_force(const Vector2 &p_force) { body->add_central_force(p_force); }
|
|
|
- virtual void add_force(const Vector2 &p_offset, const Vector2 &p_force) { body->add_force(p_offset, p_force); }
|
|
|
- virtual void add_torque(real_t p_torque) { body->add_torque(p_torque); }
|
|
|
- virtual void apply_central_impulse(const Vector2 &p_impulse) { body->apply_central_impulse(p_impulse); }
|
|
|
- virtual void apply_impulse(const Vector2 &p_offset, const Vector2 &p_force) { body->apply_impulse(p_offset, p_force); }
|
|
|
- virtual void apply_torque_impulse(real_t p_torque) { body->apply_torque_impulse(p_torque); }
|
|
|
+ virtual void add_central_force(const Vector2 &p_force) {
|
|
|
+ body->wakeup();
|
|
|
+ body->add_central_force(p_force);
|
|
|
+ }
|
|
|
+ virtual void add_force(const Vector2 &p_offset, const Vector2 &p_force) {
|
|
|
+ body->wakeup();
|
|
|
+ body->add_force(p_offset, p_force);
|
|
|
+ }
|
|
|
+ virtual void add_torque(real_t p_torque) {
|
|
|
+ body->wakeup();
|
|
|
+ body->add_torque(p_torque);
|
|
|
+ }
|
|
|
+ virtual void apply_central_impulse(const Vector2 &p_impulse) {
|
|
|
+ body->wakeup();
|
|
|
+ body->apply_central_impulse(p_impulse);
|
|
|
+ }
|
|
|
+ virtual void apply_impulse(const Vector2 &p_offset, const Vector2 &p_force) {
|
|
|
+ body->wakeup();
|
|
|
+ body->apply_impulse(p_offset, p_force);
|
|
|
+ }
|
|
|
+ virtual void apply_torque_impulse(real_t p_torque) {
|
|
|
+ body->wakeup();
|
|
|
+ body->apply_torque_impulse(p_torque);
|
|
|
+ }
|
|
|
|
|
|
virtual void set_sleep_state(bool p_enable) { body->set_active(!p_enable); }
|
|
|
virtual bool is_sleeping() const { return !body->is_active(); }
|