public bool checkPoints(FrustumEdge _edge) { var _vertices = new Vector2[2] { _edge._vertexA, _edge._vertexB }; int _passCount = 0; for (int _z = 0; _z < 2; _z++) { for (int _y = 0; _y < _boundCollection.Count; _y++) { if (_boundCollection[_y].Contains(_vertices[_z])) { // var _distMax = Vector2.Distance(_boundCollection[_y].max, _vertices[_z]); // var _distMin = Vector2.Distance(_boundCollection[_y].min, _vertices[_z]); //if(Vector2.Distance(_vertices[_z],_boundCollection[_y].min) _passCount++; break; } } } return(_passCount > 0 ? true : false); }
void Start() { //get player transform add to focus point includePlayer(_includePlayer); // instance bound manager _boundManager = new CameraBound(); if (_lvlHandle && _enableBounds) { _boundManager.FillBoundList(_lvlHandle); } //_frustumRight = new Vector2[] { _topRight, _bottomRight}; // _frustumLeft = new Vector2[] { _topLeft, _bottomLeft }; _left = new FrustumEdge(); _right = new FrustumEdge(); _up = new FrustumEdge(); _down = new FrustumEdge(); }