public void SetToUnitFrustum(bool withNear = true, bool withFar = true) { _planeList.Clear(); _planeList.Add(Plane.Create(1.0f, 0.0f, 0.0f, 1.0f)); // left plane. _planeList.Add(Plane.Create(-1.0f, 0.0f, 0.0f, 1.0f)); // right plane. _planeList.Add(Plane.Create(0.0f, 1.0f, 0.0f, 1.0f)); // bottom plane. _planeList.Add(Plane.Create(0.0f, -1.0f, 0.0f, 1.0f)); // top plane. if (withNear) { _planeList.Add(Plane.Create(0.0f, 0.0f, 1.0f, 1.0f)); // near plane } if (withFar) { _planeList.Add(Plane.Create(0.0f, 0.0f, -1.0f, 1.0f)); // far plane } }
private void UpdateSelectPlane() { if (!CanMove) { return; } Vector3 dir = TargetPos - _View.AirPlane.localPosition; if (dir.magnitude > 0.25f && Vector3.Angle(dir, OldDir) < 150) { dir.Normalize(); _View.AirPlane.localPosition += dir * Time.deltaTime * 25; } else { _View.AirPlane.localPosition = TargetPos; CanMove = false; //CurIndex = TargetIndex; if (isRight) { isRight = false; _View.PlaneList[PlaneList[0]].transform.localPosition += Step * 3 * Vector3.left; PlaneList.Add(PlaneList[0]); PlaneList.RemoveAt(0); } if (isLeft) { isLeft = false; _View.PlaneList[PlaneList[2]].transform.localPosition += Step * 3 * Vector3.right; PlaneList.Insert(0, PlaneList[2]); PlaneList.RemoveAt(PlaneList.Count - 1); } } }
public void UpdatePlaneList(List <IPlane> newPlaneList) { List <IPlane> updatedPlaneList = new List <IPlane>(); // Only select planes present in ObservableAirspace foreach (var plane in newPlaneList) { // Check if plane is within airspace bool planeInAirspace = ObservableAirspace.IsWithinArea(plane.XCoordinate, plane.YCoordinate, plane.Altitude); PlaneList.Add(plane); // Add plane to list if it's within the airspace if (planeInAirspace) { updatedPlaneList.Add(plane); } } UpdateViolatingPlanes(updatedPlaneList); // Update violating planes PlaneList = updatedPlaneList; RenditionOutputter.RenderPlanes(PlaneList); }
public static void Add(PlaneVertexArray plane) { PlaneList.Add(plane); }