Exemple #1
0
 public static void CopyProperties(this IObject3D copyTo, IObject3D copyFrom, Object3DPropertyFlags flags)
 {
     if (flags.HasFlag(Object3DPropertyFlags.Matrix))
     {
         copyTo.Matrix = copyFrom.Matrix;
     }
     if (flags.HasFlag(Object3DPropertyFlags.Color))
     {
         copyTo.Color = copyFrom.Color;
     }
     if (flags.HasFlag(Object3DPropertyFlags.MaterialIndex))
     {
         copyTo.MaterialIndex = copyFrom.MaterialIndex;
     }
     if (flags.HasFlag(Object3DPropertyFlags.Name))
     {
         copyTo.Name = copyFrom.Name;
     }
     if (flags.HasFlag(Object3DPropertyFlags.OutputType))
     {
         copyTo.OutputType = copyFrom.OutputType;
     }
     if (flags.HasFlag(Object3DPropertyFlags.Visible))
     {
         copyTo.Visible = copyFrom.Visible;
     }
 }
Exemple #2
0
 public static void CopyWorldProperties(this IObject3D copyTo, IObject3D copyFrom, IObject3D root, Object3DPropertyFlags flags)
 {
     if (flags.HasFlag(Object3DPropertyFlags.Matrix))
     {
         copyTo.Matrix = copyFrom.WorldMatrix(root);
     }
     if (flags.HasFlag(Object3DPropertyFlags.Color))
     {
         copyTo.Color = copyFrom.WorldColor(root);
     }
     if (flags.HasFlag(Object3DPropertyFlags.MaterialIndex))
     {
         copyTo.MaterialIndex = copyFrom.WorldMaterialIndex(root);
     }
     if (flags.HasFlag(Object3DPropertyFlags.Name))
     {
         copyTo.Name = copyFrom.Name;
     }
     if (flags.HasFlag(Object3DPropertyFlags.OutputType))
     {
         copyTo.OutputType = copyFrom.WorldOutputType(root);
     }
     if (flags.HasFlag(Object3DPropertyFlags.Visible))
     {
         copyTo.Visible = copyFrom.WorldVisible(root);
     }
 }