+ Mesh updating

This commit is contained in:
Michel Fedde 2021-03-24 14:54:49 +01:00
parent 9fa1ac6ad9
commit 58c5bafa1b
4 changed files with 70 additions and 18 deletions

View file

@ -103,6 +103,29 @@ namespace SM.OGL.Mesh
GL.BindVertexArray(0);
}
/// <summary>
/// This updates the parts of the mesh, that needs updating.
/// </summary>
public void Update()
{
if (!WasCompiled)
{
Compile();
return;
}
GL.BindVertexArray(_id);
UpdateBoundingBox();
foreach(var attrib in Attributes)
{
if (attrib.ConnectedVBO == null || !attrib.ConnectedVBO.Active || !attrib.ConnectedVBO.CanBeUpdated) continue;
attrib.ConnectedVBO.Update();
}
}
/// <inheritdoc />
public override void Dispose()
{