#region Using Statements using System; using System.Collections.Generic; using System.Linq; using System.Text; #endregion // This file is part of the ANX.Framework created by the // "ANX.Framework developer group" and released under the Ms-PL license. // For details see: http://anxframework.codeplex.com/license namespace ANX.Framework.Content.Pipeline.Graphics { /// /// Provides a base class for graphics types that define local coordinate systems. /// /// These objects can be arranged in a tree structure. This enables the root transform to be automatically inherited from the parent object. public class NodeContent : ContentItem { /// /// Gets the value of the local property, multiplied by the of the parent. /// /// Matrix of the object. public Matrix AbsolutTransform { get { if (Parent != null) { return this.Transform * Parent.AbsolutTransform; } return this.Transform; } } //TODO: offer useful animation system, XNA missed to implement one. /// /// Gets the set of animations belonging to this node. /// /// Collection of animations for this content item. public AnimationContentDictionary Animations { get; private set; } /// /// Gets the children of the object. /// /// Collection of children. public NodeContentCollection Children { get; private set; } /// /// Gets or sets the parent of this object. /// /// Parent of the object, or null if this object is the root of the scene. public NodeContent Parent { get; set; } public Matrix Transform { get; set; } public NodeContent() { Transform = Matrix.Identity; Animations = new AnimationContentDictionary(); Children = new NodeContentCollection(this); } } }