|
| 1 | +#include "RopeStiffnessParameters.hpp" |
| 2 | +#include "godot_cpp/core/class_db.hpp" |
| 3 | + |
| 4 | +using namespace godot; |
| 5 | + |
| 6 | +RopeStiffnessParameters::StiffnessMethod RopeStiffnessParameters::get_stiffness_method() const |
| 7 | +{ |
| 8 | + return stiffness_method; |
| 9 | +} |
| 10 | + |
| 11 | +void RopeStiffnessParameters::set_stiffness_method(StiffnessMethod method) |
| 12 | +{ |
| 13 | + stiffness_method = method; |
| 14 | + emit_changed(); |
| 15 | +} |
| 16 | + |
| 17 | +float RopeStiffnessParameters::get_stiffness() const |
| 18 | +{ |
| 19 | + return stiffness; |
| 20 | +} |
| 21 | + |
| 22 | +void RopeStiffnessParameters::set_stiffness(float value) |
| 23 | +{ |
| 24 | + stiffness = value; |
| 25 | + emit_changed(); |
| 26 | +} |
| 27 | + |
| 28 | +Ref<Curve> RopeStiffnessParameters::get_stiffness_curve() const |
| 29 | +{ |
| 30 | + return stiffness_curve; |
| 31 | +} |
| 32 | + |
| 33 | +void RopeStiffnessParameters::set_stiffness_curve(Ref<Curve> curve) |
| 34 | +{ |
| 35 | + stiffness_curve = curve; |
| 36 | + emit_changed(); |
| 37 | +} |
| 38 | + |
| 39 | +Ref<Curve> RopeStiffnessParameters::get_stiffness_bend_curve() const |
| 40 | +{ |
| 41 | + return stiffness_bend_curve; |
| 42 | +} |
| 43 | + |
| 44 | +void RopeStiffnessParameters::set_stiffness_bend_curve(Ref<Curve> curve) |
| 45 | +{ |
| 46 | + stiffness_bend_curve = curve; |
| 47 | + emit_changed(); |
| 48 | +} |
| 49 | + |
| 50 | + |
| 51 | +void RopeStiffnessParameters::_bind_methods() |
| 52 | +{ |
| 53 | + ClassDB::bind_method(D_METHOD("get_stiffness_method"), &RopeStiffnessParameters::get_stiffness_method); |
| 54 | + ClassDB::bind_method(D_METHOD("set_stiffness_method", "method"), &RopeStiffnessParameters::set_stiffness_method); |
| 55 | + ClassDB::bind_method(D_METHOD("get_stiffness"), &RopeStiffnessParameters::get_stiffness); |
| 56 | + ClassDB::bind_method(D_METHOD("set_stiffness", "value"), &RopeStiffnessParameters::set_stiffness); |
| 57 | + ClassDB::bind_method(D_METHOD("get_stiffness_curve"), &RopeStiffnessParameters::get_stiffness_curve); |
| 58 | + ClassDB::bind_method(D_METHOD("set_stiffness_curve", "curve"), &RopeStiffnessParameters::set_stiffness_curve); |
| 59 | + ClassDB::bind_method(D_METHOD("get_stiffness_bend_curve"), &RopeStiffnessParameters::get_stiffness_bend_curve); |
| 60 | + ClassDB::bind_method(D_METHOD("set_stiffness_bend_curve", "curve"), &RopeStiffnessParameters::set_stiffness_bend_curve); |
| 61 | + |
| 62 | + ADD_PROPERTY(PropertyInfo(Variant::INT, "stiffness_method", PROPERTY_HINT_ENUM, stiffness_method_strings), "set_stiffness_method", "get_stiffness_method"); |
| 63 | + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "stiffness"), "set_stiffness", "get_stiffness"); |
| 64 | + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stiffness_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_stiffness_curve", "get_stiffness_curve"); |
| 65 | + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stiffness_bend_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_stiffness_bend_curve", "get_stiffness_bend_curve"); |
| 66 | + |
| 67 | + BIND_ENUM_CONSTANT(Bidirectional); |
| 68 | + BIND_ENUM_CONSTANT(Legacy); |
| 69 | +} |
0 commit comments