Beispiel #1
0
        public bool Intersects(BoundingCircles otherCircle)
        {
            //Create a vector representing the direction and length of the other circle
            Vector3 VectorToOther = otherCircle.CentrePoint - CentrePoint;

            //Calculate our combined radii squared
            float CombinedRadiusSq = (otherCircle.Radius + Radius);

            CombinedRadiusSq *= CombinedRadiusSq;

            //Return the boolean statement below, if true they intersect
            return(VectorAlgorithm.PlayerVector.LengthSq(VectorToOther) <= CombinedRadiusSq);
        }
Beispiel #2
0
 void Start()
 {
     boundingCircle = new BoundingCircles(GetComponent <MatrixController>().position, 5.0f);
 }