StaticMeshBuilder.cs 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Numerics;
  5. using System.Text;
  6. namespace SharpGLTF.Geometry
  7. {
  8. using VertexTypes;
  9. /// <summary>
  10. /// Represents an utility class to help build meshes by adding primitives associated with a given material.
  11. /// </summary>
  12. /// <typeparam name="TvP">
  13. /// The vertex fragment type with Position, Normal and Tangent.
  14. /// Valid types are:
  15. /// <see cref="VertexPosition"/>,
  16. /// <see cref="VertexPositionNormal"/>,
  17. /// <see cref="VertexPositionNormalTangent"/>.
  18. /// </typeparam>
  19. /// <typeparam name="TvM">
  20. /// The vertex fragment type with Colors and Texture Coordinates.
  21. /// Valid types are:
  22. /// <see cref="VertexEmpty"/>,
  23. /// <see cref="VertexColor1"/>,
  24. /// <see cref="VertexTexture1"/>,
  25. /// <see cref="VertexColor1Texture1"/>.
  26. /// </typeparam>
  27. /// <typeparam name="TvJ">
  28. /// The vertex fragment type with Skin Joint Weights.
  29. /// Valid types are:
  30. /// <see cref="VertexEmpty"/>,
  31. /// <see cref="VertexJoints8x4"/>,
  32. /// <see cref="VertexJoints8x8"/>,
  33. /// <see cref="VertexJoints16x4"/>,
  34. /// <see cref="VertexJoints16x8"/>.
  35. /// </typeparam>
  36. public class MeshBuilder<TvP, TvM, TvJ> : MeshBuilder<Materials.MaterialBuilder, TvP, TvM, TvJ>
  37. where TvP : struct, IVertexPosition
  38. where TvM : struct, IVertexMaterial
  39. where TvJ : struct, IVertexJoints
  40. {
  41. public MeshBuilder(string name = null)
  42. : base(name) { }
  43. }
  44. /// <summary>
  45. /// Represents an utility class to help build meshes by adding primitives associated with a given material.
  46. /// </summary>
  47. /// <typeparam name="TvP">
  48. /// The vertex fragment type with Position, Normal and Tangent.
  49. /// Valid types are:
  50. /// <see cref="VertexPosition"/>,
  51. /// <see cref="VertexPositionNormal"/>,
  52. /// <see cref="VertexPositionNormalTangent"/>.
  53. /// </typeparam>
  54. /// <typeparam name="TvM">
  55. /// The vertex fragment type with Colors and Texture Coordinates.
  56. /// Valid types are:
  57. /// <see cref="VertexEmpty"/>,
  58. /// <see cref="VertexColor1"/>,
  59. /// <see cref="VertexTexture1"/>,
  60. /// <see cref="VertexColor1Texture1"/>.
  61. /// </typeparam>
  62. public class MeshBuilder<TvP, TvM> : MeshBuilder<Materials.MaterialBuilder, TvP, TvM, VertexEmpty>
  63. where TvP : struct, IVertexPosition
  64. where TvM : struct, IVertexMaterial
  65. {
  66. public MeshBuilder(string name = null)
  67. : base(name) { }
  68. }
  69. /// <summary>
  70. /// Represents an utility class to help build meshes by adding primitives associated with a given material.
  71. /// </summary>
  72. /// <typeparam name="TvP">
  73. /// The vertex fragment type with Position, Normal and Tangent.
  74. /// Valid types are:
  75. /// <see cref="VertexPosition"/>,
  76. /// <see cref="VertexPositionNormal"/>,
  77. /// <see cref="VertexPositionNormalTangent"/>.
  78. /// </typeparam>
  79. public class MeshBuilder<TvP> : MeshBuilder<Materials.MaterialBuilder, TvP, VertexEmpty, VertexEmpty>
  80. where TvP : struct, IVertexPosition
  81. {
  82. public MeshBuilder(string name = null)
  83. : base(name) { }
  84. }
  85. }