Deprecate a typo for a new method introduced in 3.0.1

This commit is contained in:
Hein-Pieter van Braam 2018-02-27 16:15:48 +01:00
parent a850ebf352
commit 7e5a374825
6 changed files with 21 additions and 3 deletions

View File

@ -29,6 +29,15 @@
<description> <description>
</description> </description>
</method> </method>
<method name="apply_torqe_impulse">
<return type="void">
</return>
<argument index="0" name="j" type="Vector3">
</argument>
<description>
This method is deprecated. Please use [method apply_torque_impulse] instead.
</description>
</method>
<method name="apply_torque_impulse"> <method name="apply_torque_impulse">
<return type="void"> <return type="void">
</return> </return>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="@C#" category="Core" version="3.0-stable"> <class name="@C#" category="Core" version="3.0.2">
<brief_description> <brief_description>
</brief_description> </brief_description>
<description> <description>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="CSharpScript" inherits="Script" category="Core" version="3.0-stable"> <class name="CSharpScript" inherits="Script" category="Core" version="3.0.2">
<brief_description> <brief_description>
</brief_description> </brief_description>
<description> <description>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="GodotSharp" inherits="Object" category="Core" version="3.0-stable"> <class name="GodotSharp" inherits="Object" category="Core" version="3.0.2">
<brief_description> <brief_description>
</brief_description> </brief_description>
<description> <description>

View File

@ -94,6 +94,8 @@ void PhysicsDirectBodyState::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_force", "force", "position"), &PhysicsDirectBodyState::add_force); ClassDB::bind_method(D_METHOD("add_force", "force", "position"), &PhysicsDirectBodyState::add_force);
ClassDB::bind_method(D_METHOD("apply_impulse", "position", "j"), &PhysicsDirectBodyState::apply_impulse); ClassDB::bind_method(D_METHOD("apply_impulse", "position", "j"), &PhysicsDirectBodyState::apply_impulse);
// This typo made it into 3.0.1. We'll leave it in until 3.1
ClassDB::bind_method(D_METHOD("apply_torqe_impulse", "j"), &PhysicsDirectBodyState::_apply_torqe_impulse_deprecated);
ClassDB::bind_method(D_METHOD("apply_torque_impulse", "j"), &PhysicsDirectBodyState::apply_torque_impulse); ClassDB::bind_method(D_METHOD("apply_torque_impulse", "j"), &PhysicsDirectBodyState::apply_torque_impulse);
ClassDB::bind_method(D_METHOD("set_sleep_state", "enabled"), &PhysicsDirectBodyState::set_sleep_state); ClassDB::bind_method(D_METHOD("set_sleep_state", "enabled"), &PhysicsDirectBodyState::set_sleep_state);

View File

@ -65,6 +65,13 @@ public:
virtual void add_force(const Vector3 &p_force, const Vector3 &p_pos) = 0; virtual void add_force(const Vector3 &p_force, const Vector3 &p_pos) = 0;
virtual void apply_impulse(const Vector3 &p_pos, const Vector3 &p_j) = 0; virtual void apply_impulse(const Vector3 &p_pos, const Vector3 &p_j) = 0;
void _apply_torqe_impulse_deprecated(const Vector3 &p_j) {
WARN_PRINT("This method is deprecated and will be removed in 3.1. Use `apply_torque_impulse` instead.");
apply_torque_impulse(p_j);
}
virtual void apply_torque_impulse(const Vector3 &p_j) = 0; virtual void apply_torque_impulse(const Vector3 &p_j) = 0;
virtual void set_sleep_state(bool p_enable) = 0; virtual void set_sleep_state(bool p_enable) = 0;