summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-06-04 11:34:35 +0200
committerGitHub <noreply@github.com>2021-06-04 11:34:35 +0200
commit95ff547da4aba872dd042d3b670945eab6eb5b48 (patch)
tree046ab50be87687a11f7f3323f648170b1a04c2df /scene
parent875ed4d600e6ae3a41841443a34ed4ede1c8e6fd (diff)
parenta6e44bd16c89b454dba697c96a0ee47c6a7ff156 (diff)
Merge pull request #44198 from madmiraal/rename-translation-position
Rename Node3D's property translation to position
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/node_3d.cpp12
-rw-r--r--scene/3d/node_3d.h4
-rw-r--r--scene/3d/xr_nodes.cpp2
3 files changed, 9 insertions, 9 deletions
diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp
index d6ce8e99dc..e96e4df55c 100644
--- a/scene/3d/node_3d.cpp
+++ b/scene/3d/node_3d.cpp
@@ -299,8 +299,8 @@ Transform3D Node3D::get_relative_transform(const Node *p_parent) const {
}
}
-void Node3D::set_translation(const Vector3 &p_translation) {
- data.local_transform.origin = p_translation;
+void Node3D::set_position(const Vector3 &p_position) {
+ data.local_transform.origin = p_position;
_propagate_transform_changed(this);
if (data.notify_local_transform) {
notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
@@ -339,7 +339,7 @@ void Node3D::set_scale(const Vector3 &p_scale) {
}
}
-Vector3 Node3D::get_translation() const {
+Vector3 Node3D::get_position() const {
return data.local_transform.origin;
}
@@ -693,8 +693,8 @@ void Node3D::force_update_transform() {
void Node3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_transform", "local"), &Node3D::set_transform);
ClassDB::bind_method(D_METHOD("get_transform"), &Node3D::get_transform);
- ClassDB::bind_method(D_METHOD("set_translation", "translation"), &Node3D::set_translation);
- ClassDB::bind_method(D_METHOD("get_translation"), &Node3D::get_translation);
+ ClassDB::bind_method(D_METHOD("set_position", "position"), &Node3D::set_position);
+ ClassDB::bind_method(D_METHOD("get_position"), &Node3D::get_position);
ClassDB::bind_method(D_METHOD("set_rotation", "euler"), &Node3D::set_rotation);
ClassDB::bind_method(D_METHOD("get_rotation"), &Node3D::get_rotation);
ClassDB::bind_method(D_METHOD("set_rotation_degrees", "euler_degrees"), &Node3D::set_rotation_degrees);
@@ -759,7 +759,7 @@ void Node3D::_bind_methods() {
//ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM3D,"transform/global",PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR ), "set_global_transform", "get_global_transform") ;
ADD_GROUP("Transform", "");
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM3D, "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, "position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_position", "get_position");
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");
diff --git a/scene/3d/node_3d.h b/scene/3d/node_3d.h
index 175885141e..09a96bf8ca 100644
--- a/scene/3d/node_3d.h
+++ b/scene/3d/node_3d.h
@@ -122,12 +122,12 @@ public:
Ref<World3D> get_world_3d() const;
- void set_translation(const Vector3 &p_translation);
+ void set_position(const Vector3 &p_position);
void set_rotation(const Vector3 &p_euler_rad);
void set_rotation_degrees(const Vector3 &p_euler_deg);
void set_scale(const Vector3 &p_scale);
- Vector3 get_translation() const;
+ Vector3 get_position() const;
Vector3 get_rotation() const;
Vector3 get_rotation_degrees() const;
Vector3 get_scale() const;
diff --git a/scene/3d/xr_nodes.cpp b/scene/3d/xr_nodes.cpp
index d959160315..09662f3e7a 100644
--- a/scene/3d/xr_nodes.cpp
+++ b/scene/3d/xr_nodes.cpp
@@ -493,7 +493,7 @@ TypedArray<String> XRAnchor3D::get_configuration_warnings() const {
};
Plane XRAnchor3D::get_plane() const {
- Vector3 location = get_translation();
+ Vector3 location = get_position();
Basis orientation = get_transform().basis;
Plane plane(location, orientation.get_axis(1).normalized());