2012-08-16 08:17:47 +00:00
#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
{
2015-04-08 14:50:03 +02:00
/// <summary>
/// Provides a base class for graphics types that define local coordinate systems.
/// </summary>
/// <remarks>These objects can be arranged in a tree structure. This enables the root transform to be automatically inherited from the parent object.</remarks>
2012-08-16 08:17:47 +00:00
public class NodeContent : ContentItem
{
2015-04-08 14:50:03 +02:00
/// <summary>
/// Gets the value of the local <see cref="Transform"/> property, multiplied by the <see cref="AbsoluteTransform"/> of the parent.
/// </summary>
/// <value>Matrix of the <see cref="NodeContent"/> object. </value>
2012-08-16 08:17:47 +00:00
public Matrix AbsolutTransform
{
2012-08-25 21:47:03 +00:00
get
{
if ( Parent ! = null )
{
return this . Transform * Parent . AbsolutTransform ;
}
return this . Transform ;
}
2012-08-16 08:17:47 +00:00
}
2015-04-08 14:50:03 +02:00
//TODO: offer useful animation system, XNA missed to implement one.
/// <summary>
/// Gets the set of animations belonging to this node.
/// </summary>
/// <value>Collection of animations for this content item.</value>
public AnimationContentDictionary Animations
2012-08-16 08:17:47 +00:00
{
get ;
private set ;
}
2015-04-08 14:50:03 +02:00
/// <summary>
/// Gets the children of the <see cref="NodeContent"/> object.
/// </summary>
/// <value>Collection of children.</value>
2012-08-16 08:17:47 +00:00
public NodeContentCollection Children
{
get ;
private set ;
}
2015-04-08 14:50:03 +02:00
/// <summary>
/// Gets or sets the parent of this <see cref="NodeContent"/> object.
/// </summary>
/// <value>Parent of the <see cref="NodeContent"/> object, or null if this object is the root of the scene.</value>
2012-08-16 08:17:47 +00:00
public NodeContent Parent
{
get ;
set ;
}
public Matrix Transform
{
get ;
set ;
}
2012-08-25 21:47:03 +00:00
public NodeContent ( )
{
Transform = Matrix . Identity ;
2015-04-08 14:50:03 +02:00
Animations = new AnimationContentDictionary ( ) ;
2012-08-25 21:47:03 +00:00
Children = new NodeContentCollection ( this ) ;
}
2012-08-16 08:17:47 +00:00
}
}