diff options
author | letheed <letheed@outlook.com> | 2017-11-10 11:07:52 +0100 |
---|---|---|
committer | letheed <letheed@outlook.com> | 2017-11-10 12:52:07 +0100 |
commit | 482e07af7e5c8b85463f950036dc7b14cb8cd3b4 (patch) | |
tree | 3c0571bc1071e966318de890fbe2f0b45e80427f /scene/3d | |
parent | 4deac219b0af86b7f80168920c8bedd070aa79c0 (diff) |
Unify degree members and properties
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/spatial.cpp | 14 | ||||
-rw-r--r-- | scene/3d/spatial.h | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index bc306481ce..588aa2881a 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -233,7 +233,7 @@ void Spatial::set_transform(const Transform &p_transform) { data.dirty |= DIRTY_VECTORS; _change_notify("translation"); _change_notify("rotation"); - _change_notify("rotation_deg"); + _change_notify("rotation_degrees"); _change_notify("scale"); _propagate_transform_changed(this); if (data.notify_local_transform) { @@ -327,7 +327,7 @@ void Spatial::set_rotation(const Vector3 &p_euler_rad) { } } -void Spatial::set_rotation_in_degrees(const Vector3 &p_euler_deg) { +void Spatial::set_rotation_degrees(const Vector3 &p_euler_deg) { set_rotation(p_euler_deg * Math_PI / 180.0); } @@ -364,7 +364,7 @@ Vector3 Spatial::get_rotation() const { return data.rotation; } -Vector3 Spatial::get_rotation_in_degrees() const { +Vector3 Spatial::get_rotation_degrees() const { return get_rotation() * 180.0 / Math_PI; } @@ -677,10 +677,10 @@ void Spatial::_bind_methods() { ClassDB::bind_method(D_METHOD("get_transform"), &Spatial::get_transform); ClassDB::bind_method(D_METHOD("set_translation", "translation"), &Spatial::set_translation); ClassDB::bind_method(D_METHOD("get_translation"), &Spatial::get_translation); - ClassDB::bind_method(D_METHOD("set_rotation", "rotation_rad"), &Spatial::set_rotation); + ClassDB::bind_method(D_METHOD("set_rotation", "radians"), &Spatial::set_rotation); ClassDB::bind_method(D_METHOD("get_rotation"), &Spatial::get_rotation); - ClassDB::bind_method(D_METHOD("set_rotation_deg", "rotation_deg"), &Spatial::set_rotation_in_degrees); - ClassDB::bind_method(D_METHOD("get_rotation_deg"), &Spatial::get_rotation_in_degrees); + ClassDB::bind_method(D_METHOD("set_rotation_degrees", "degrees"), &Spatial::set_rotation_degrees); + ClassDB::bind_method(D_METHOD("get_rotation_degrees"), &Spatial::get_rotation_degrees); ClassDB::bind_method(D_METHOD("set_scale", "scale"), &Spatial::set_scale); ClassDB::bind_method(D_METHOD("get_scale"), &Spatial::get_scale); ClassDB::bind_method(D_METHOD("set_global_transform", "global"), &Spatial::set_global_transform); @@ -746,7 +746,7 @@ void Spatial::_bind_methods() { ADD_PROPERTYNZ(PropertyInfo(Variant::TRANSFORM, "transform", PROPERTY_HINT_NONE, ""), "set_transform", "get_transform"); ADD_PROPERTYNZ(PropertyInfo(Variant::TRANSFORM, "global_transform", PROPERTY_HINT_NONE, "", 0), "set_global_transform", "get_global_transform"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "translation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_translation", "get_translation"); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "rotation_deg", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_rotation_deg", "get_rotation_deg"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "rotation_degrees", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_rotation_degrees", "get_rotation_degrees"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "rotation", PROPERTY_HINT_NONE, "", 0), "set_rotation", "get_rotation"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "scale", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_scale", "get_scale"); ADD_GROUP("Visibility", ""); diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h index afac855de0..8f53b4a066 100644 --- a/scene/3d/spatial.h +++ b/scene/3d/spatial.h @@ -132,12 +132,12 @@ public: void set_translation(const Vector3 &p_translation); void set_rotation(const Vector3 &p_euler_rad); - void set_rotation_in_degrees(const Vector3 &p_euler_deg); + void set_rotation_degrees(const Vector3 &p_euler_deg); void set_scale(const Vector3 &p_scale); Vector3 get_translation() const; Vector3 get_rotation() const; - Vector3 get_rotation_in_degrees() const; + Vector3 get_rotation_degrees() const; Vector3 get_scale() const; void set_transform(const Transform &p_transform); |