diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/spatial.cpp | 7 | ||||
-rw-r--r-- | scene/3d/spatial.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index edca62ece5..6e11855543 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -660,6 +660,12 @@ void Spatial::orthonormalize() { } +void Spatial::set_identity() { + + set_transform(Transform()); + +} + void Spatial::look_at(const Vector3& p_target, const Vector3& p_up_normal) { @@ -735,6 +741,7 @@ void Spatial::_bind_methods() { ObjectTypeDB::bind_method( _MD("translate","offset"),&Spatial::translate ); ObjectTypeDB::bind_method( _MD("global_translate","offset"),&Spatial::global_translate ); ObjectTypeDB::bind_method( _MD("orthonormalize"),&Spatial::orthonormalize ); + ObjectTypeDB::bind_method( _MD("set_identity"),&Spatial::set_identity ); ObjectTypeDB::bind_method( _MD("look_at","target","up"),&Spatial::look_at ); ObjectTypeDB::bind_method( _MD("look_at_from_pos","pos","target","up"),&Spatial::look_at_from_pos ); diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h index d7addbb792..f2cde8f1e6 100644 --- a/scene/3d/spatial.h +++ b/scene/3d/spatial.h @@ -180,6 +180,7 @@ public: void look_at_from_pos(const Vector3& p_pos,const Vector3& p_target, const Vector3& p_up_normal); void orthonormalize(); + void set_identity(); void show(); void hide(); |