void OnPostRender() { //vertices = new List<Vector2>(); if (!mat) { Debug.Log("Mat null"); return; } mat.SetPass(0); GL.PushMatrix(); GL.Begin(GL.LINES); for (int i = 0; i < vertices.Count; i += 2) { GL.Color(vertices[i].Key); GL.Vertex(MiscHelperFuncs.convertToVec3(vertices[i].Value) + new Vector3(0, 0, 1f)); GL.Vertex(MiscHelperFuncs.convertToVec3(vertices[i + 1].Value) + new Vector3(0, 0, 1f)); } GL.End(); GL.PopMatrix(); //Debug.Log(1.0/Time.deltaTime); //clear vertices //vertices = new List<Vector2>(); }
public static bool clockwiseOrbit(Vector2 position, Vector2 velocity) { Vector3 crossProduct; crossProduct = Vector3.Cross(MiscHelperFuncs.convertToVec3(position), MiscHelperFuncs.convertToVec3(velocity)); if (crossProduct.z > 0) { return(false); } return(true); }