public static KeplerVertexBuffer Create(List <KeplerVertex> items) { KeplerVertexBuffer tmp = new KeplerVertexBuffer(items.Count); tmp.verts = (KeplerVertex[])(object)items; return(tmp); }
public static void InitMPCVertexBuffer() { try { if (mpcVertexBuffer == null) { KeplerVertexBuffer[] mpcVertexBufferTemp = new KeplerVertexBuffer[7]; mpcCount = MinorPlanets.MPCList.Count; //KeplerVertexBuffer11 temp = new KeplerVertexBuffer11(mpcCount, RenderContext11.PrepDevice); List <KeplerVertex>[] lists = new List <KeplerVertex> [7]; for (int i = 0; i < 7; i++) { lists[i] = new List <KeplerVertex>(); } foreach (EOE ee in MinorPlanets.MPCList) { int listID = 0; if (ee.a < 2.5) { listID = 0; } else if (ee.a < 2.83) { listID = 1; } else if (ee.a < 2.96) { listID = 2; } else if (ee.a < 3.3) { listID = 3; } else if (ee.a < 5) { listID = 4; } else if (ee.a < 10) { listID = 5; } else { listID = 6; } KeplerVertex vert = new KeplerVertex(); vert.Fill(ee); lists[listID].Add(vert); } for (int i = 0; i < 7; i++) { mpcVertexBufferTemp[i] = KeplerVertexBuffer.Create(lists[i]); mpcVertexBufferTemp[i].Unlock(); } mpcVertexBuffer = mpcVertexBufferTemp; } } finally { } }