ProxyMesh.cs 930 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using BabylonExport.Core.Exporters;
  3. using SharpDX;
  4. namespace BabylonExport.Core
  5. {
  6. public class ProxyMesh
  7. {
  8. public static Guid CreateBabylonMesh(string name, BabylonScene scene)
  9. {
  10. var babylonMesh = new BabylonMesh();
  11. scene.MeshesList.Add(babylonMesh);
  12. // Guid
  13. var id = Guid.NewGuid();
  14. babylonMesh.id = id.ToString();
  15. // Name
  16. babylonMesh.name = name;
  17. // Parent
  18. babylonMesh.parentId = "";
  19. // Visible
  20. babylonMesh.isVisible = false;
  21. // Material ID
  22. babylonMesh.materialId = "";
  23. // Position
  24. babylonMesh.position = Vector3.Zero.ToArray();
  25. // Vertices
  26. babylonMesh.positions = null;
  27. // Faces
  28. babylonMesh.indices = null;
  29. return id;
  30. }
  31. }
  32. }