diff --git a/src/Engine/Core/Scene/SceneExtensions.cs b/src/Engine/Core/Scene/SceneExtensions.cs index 39cdffd74..6bdac6d63 100644 --- a/src/Engine/Core/Scene/SceneExtensions.cs +++ b/src/Engine/Core/Scene/SceneExtensions.cs @@ -537,6 +537,24 @@ public static void FpsView(this Transform tc, float angleHorz, float angleVert, tc.Rotation = new float3(angleVert, angleHorz, 0); } + /// + /// This creates a shallow copy of this SceneNode with the abillity to be copied into a derived class. It does not connect the resullting copy with this SceneNodes parent. + /// + /// Target type + /// + /// + public static TOut ShallowCopy(this SceneNode sn) + where TOut : SceneNode, new() + { + TOut tout = new TOut(); + + tout.Name = sn.Name; + tout.Components = sn.Components; + tout.Children = sn.Children; + + return tout; + } + /// /// Reference space for rotation. ///