public CompiledMeshNode(CompiledModel Mesh, Texture2D Texture, Euler Orientation = null) { this.Mesh = Mesh; this.Texture = Texture; this.Orientation = Orientation; if (this.Orientation == null) this.Orientation = new Euler(); }
public static CompiledModel CompileModel(Mesh model, GraphicsDevice device) { CompiledModel result = new CompiledModel(); result.indicies = new IndexBuffer(device, typeof(Int16), model.indicies.Length, BufferUsage.WriteOnly); result.indicies.SetData(model.indicies); result.verticies = new VertexBuffer(device, typeof(Vertex), model.verticies.Length, BufferUsage.WriteOnly); result.verticies.SetData(model.verticies); result.primitiveCount = model.indicies.Length / 3; return result; }
public static CompiledModel CompileModel(Mesh model, GraphicsDevice device) { CompiledModel result = new CompiledModel(); result.indicies = new IndexBuffer(device, typeof(Int16), model.indicies.Length, BufferUsage.WriteOnly); result.indicies.SetData(model.indicies); result.verticies = new VertexBuffer(device, typeof(VertexPositionNormalTexture), model.verticies.Length, BufferUsage.WriteOnly); result.verticies.SetData(model.verticies); result.primitiveCount = model.indicies.Length / 3; return(result); }
public Renderable(GraphicsDevice device, GuiDriver module, int width, int height, Euler Euler = null) { this.module = module; this.Orientation = Euler; if (this.Orientation == null) this.Orientation = new Euler(); uiCamera = new Render.Cameras.OrthographicCamera(new Viewport(0, 0, width, height)); uiRoot = new UIItem(new Rectangle(0, 0, width, height)); uiRoot.settings = new PropertySet(); uiCamera.focus = new Vector2(width / 2, height / 2); renderTarget = new RenderTarget2D(device, uiCamera.Viewport.Width, uiCamera.Viewport.Height); var rawGuiQuad = Geo.Gen.CreateQuad(); rawGuiQuad = Geo.Gen.FacetCopy(rawGuiQuad); quadModel = Geo.CompiledModel.CompileModel(rawGuiQuad, device); uiRoot.defaults = module.defaultSettings; }