public virtual void DrawWireframe(float r, float g, float b, float a = 1, float tickness = 0.02f)
{
if (this.v == null)
return;
// check if vcs neet to be temporarily stored
// and check if the shader supports them
if (!this.hasVertexColors)
return;
// store original vcs
float[] vcs_storage = this.vc;
int numVcs = this.v.Length * 2;
this.vc = new float[numVcs];
for (int i = 0; i < numVcs; i += 12)
{
this.vc[i] = 1f;
this.vc[i + 1] = 0f;
this.vc[i + 2] = 0f;
this.vc[i + 4] = 0f;
this.vc[i + 5] = 1f;
this.vc[i + 6] = 0f;
this.vc[i + 8] = 0f;
this.vc[i + 9] = 0f;
this.vc[i + 10] = 1f;
}
this.UpdateVertexColor();
this.shader.SetUniform("color", new Vector4(r, g, b, a));
this.shader.SetUniform("use_wireframe", tickness);
this.Draw();
this.shader.SetUniform("use_wireframe", -1f);
// always reset the color
this.shader.SetUniform("color", Vector4.Zero);
// reset old vcs (could be null)
this.vc = vcs_storage;
}