/Rendering/SceneGraph/SceneGraphNodeMesh.cs
C# | 75 lines | 35 code | 5 blank | 35 comment | 2 complexity | 83d0f06bb3f86d2f3af5ca639cd0a0ee MD5 | raw file
Possible License(s): Apache-2.0
- #region License
- /* Copyright : Santtu Syrjälä
- * License : New BSD
- *
- * SceneGraphNode for Delta Engine
- *
- * General purpose scene graph for 2D and 3D that is compatible with Delta Engines vertex constructs, cameras and rendering pipeline.
- *
- * If You find a bug, find a way to make it work faster or other additions to make it more useful please share them! You can find me in Delta Engine forums. You will get Your name
- * in here if YOU WISH.
- *
- * Addition : I don't wa...(of course I want) NEED money for this thing. I though would like You to include me in the credits portion of Your application if You like/use
- * this. It is NOT REQUIRED, though it would serve as a little thanks that would warm this programmer's heart.
- *
- * Changes :
- * 10.09.2011 : Release of the preview 0.1.0.0
- */
- #endregion
-
- using Delta.Rendering.Models;
-
- namespace Delta.Rendering.SceneGraph
- {
- /// <summary>
- /// SceneGraphNode for Mesh based data.
- /// </summary>
- public class SceneGraphNodeMesh : SceneGraphNode
- {
- #region Mesh (Public)
- /// <summary>
- /// Gets or Sets the <see cref="Mesh"/> to be rendered.
- /// </summary>
- public Mesh Mesh
- {
- get;
- set;
- }
- #endregion
-
- #region Constructors
- /// <summary>
- /// Creates a new instance of <see cref="SceneGraphNodeMesh"/>.
- /// </summary>
- /// <param name="mesh">Mesh to be rendered.</param>
- public SceneGraphNodeMesh(Mesh mesh)
- {
- Mesh = mesh;
- }
-
- /// <summary>
- /// Creates a new instance of <see cref="SceneGraphNodeMesh"/>.
- /// </summary>
- /// <remarks>
- /// You need to set the Mesh later for correct rendering.
- /// </remarks>
- public SceneGraphNodeMesh()
- : this(null)
- {
- }
- #endregion
-
- #region Render (Public)
- /// <summary>
- /// Overriden Render method to render the Mesh.
- /// </summary>
- public override void Render()
- {
- if (Mesh != null)
- {
- Mesh.Draw(ref worldTransformation);
- }
- }
- #endregion
- }
- }