public unsafe IMesh[] Import(string fileName) { var newMeshes = new List <IMesh>(); var context = new AssimpContext(); var scene = context.ImportFile(fileName); foreach (var mesh in scene.Meshes) { var newMesh = _packet.CreateScoped <IMesh>(); var indices = new List <uint>(); var vertex = new List <PositionNormalUVTIDVertex>(); foreach (var face in mesh.Faces) { indices.AddRange((IEnumerable <uint>)face.Indices); } for (var i = 0; i < mesh.VertexCount; i++) { var vertice = mesh.Vertices[i]; var normal = mesh.Normals[i]; vertex.Add(new PositionNormalUVTIDVertex(*(Vector3 *)&vertice, *(Vector3 *)&normal, new Vector2(0), 0)); } newMesh.VertexArray = vertex; newMesh.IndexArray = indices; newMesh.ModelMatrix = Matrix.Identity; // TODO: copy material stuff. // newMesh.Material = newMeshes.Add(newMesh); } return(newMeshes.ToArray()); }
public void Start(TaskArgs args) { var provider = _packet.CreateScoped <IWindowProvider>(); provider.Adopt <MainWindow>(); provider.Start(); }
public GLWindowProvider(ModulePacket packet) : base(GameWindowSettings.Default, new NativeWindowSettings() { Size = new OpenTK.Mathematics.Vector2i(1600, 900), APIVersion = new Version(4, 6) }) { _packet = packet; _taskManager = packet.CreateScoped <ITaskManager>(); FrameQueue = new Queue <Action>(); }
public SDKBase(ModulePacket packet) { _parser = packet.CreateScoped <IParser>(); }