using System.Collections.Generic; using SM.Base.Contexts; using SM.Base.Objects.Static; using SM.OGL.Mesh; namespace SM.Base.Scene { /// /// Contains general basis systems for drawing objects. /// public abstract class DrawingBasis : IShowItem { /// /// The material it should use. /// protected Material _material = new Material(); /// /// The mesh it should use. /// protected GenericMesh _mesh = SMRenderer.DefaultMesh; /// public object Parent { get; set; } /// public string Name { get; set; } = "Unnamed draw object"; /// public ICollection Flags { get; set; } /// public virtual void Update(UpdateContext context) { } /// public void Draw(DrawContext context) { context.Material = _material; context.Mesh = _mesh; DrawContext(ref context); } /// public virtual void OnAdded(object sender) { } /// public virtual void OnRemoved(object sender) { } /// /// Draws the context, that was given to them. /// /// protected virtual void DrawContext(ref DrawContext context) { } } /// /// Contains general basis systems for drawing objects. /// /// The transformation type public abstract class DrawingBasis : DrawingBasis where TTransformation : GenericTransformation, new() { /// /// The current transformation. /// public TTransformation Transform = new TTransformation(); } }