PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/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
  1. #region License
  2. /* Copyright : Santtu Syrjälä
  3. * License : New BSD
  4. *
  5. * SceneGraphNode for Delta Engine
  6. *
  7. * General purpose scene graph for 2D and 3D that is compatible with Delta Engines vertex constructs, cameras and rendering pipeline.
  8. *
  9. * 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
  10. * in here if YOU WISH.
  11. *
  12. * 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
  13. * this. It is NOT REQUIRED, though it would serve as a little thanks that would warm this programmer's heart.
  14. *
  15. * Changes :
  16. * 10.09.2011 : Release of the preview 0.1.0.0
  17. */
  18. #endregion
  19. using Delta.Rendering.Models;
  20. namespace Delta.Rendering.SceneGraph
  21. {
  22. /// <summary>
  23. /// SceneGraphNode for Mesh based data.
  24. /// </summary>
  25. public class SceneGraphNodeMesh : SceneGraphNode
  26. {
  27. #region Mesh (Public)
  28. /// <summary>
  29. /// Gets or Sets the <see cref="Mesh"/> to be rendered.
  30. /// </summary>
  31. public Mesh Mesh
  32. {
  33. get;
  34. set;
  35. }
  36. #endregion
  37. #region Constructors
  38. /// <summary>
  39. /// Creates a new instance of <see cref="SceneGraphNodeMesh"/>.
  40. /// </summary>
  41. /// <param name="mesh">Mesh to be rendered.</param>
  42. public SceneGraphNodeMesh(Mesh mesh)
  43. {
  44. Mesh = mesh;
  45. }
  46. /// <summary>
  47. /// Creates a new instance of <see cref="SceneGraphNodeMesh"/>.
  48. /// </summary>
  49. /// <remarks>
  50. /// You need to set the Mesh later for correct rendering.
  51. /// </remarks>
  52. public SceneGraphNodeMesh()
  53. : this(null)
  54. {
  55. }
  56. #endregion
  57. #region Render (Public)
  58. /// <summary>
  59. /// Overriden Render method to render the Mesh.
  60. /// </summary>
  61. public override void Render()
  62. {
  63. if (Mesh != null)
  64. {
  65. Mesh.Draw(ref worldTransformation);
  66. }
  67. }
  68. #endregion
  69. }
  70. }