// MonoGame - Copyright (C) The MonoGame Team // This file is subject to the terms and conditions defined in // file 'LICENSE.txt', which is part of this source code package. namespace Microsoft.Xna.Framework.Content.Pipeline.Graphics { /// /// Provides a base class for graphics types that define local coordinate systems. /// [System.Diagnostics.DebuggerDisplay("Node '{Name}'")] public class NodeContent : ContentItem { Matrix transform; NodeContent parent; NodeContentCollection children; AnimationContentDictionary animations; /// /// Gets the value of the local Transform property, multiplied by the AbsoluteTransform of the parent. /// public Matrix AbsoluteTransform { get { if (parent != null) return transform * parent.AbsoluteTransform; return transform; } } /// /// Gets the set of animations belonging to this node. /// public AnimationContentDictionary Animations { get { return animations; } } /// /// Gets the children of the NodeContent object. /// public NodeContentCollection Children { get { return children; } } /// /// Gets the parent of this NodeContent object. /// public NodeContent Parent { get { return parent; } set { parent = value; } } /// /// Gets the transform matrix of the scene. /// The transform matrix defines a local coordinate system for the content in addition to any children of this object. /// public Matrix Transform { get { return transform; } set { transform = value; } } /// /// Creates an instance of NodeContent. /// public NodeContent() { children = new NodeContentCollection(this); animations = new AnimationContentDictionary(); Transform = Matrix.Identity; } } }