示例#1
0
        protected Thing(Galaxia galaxia, Vector2 size, Vector2 position, float rotation)
        {
            this.centro   = position;
            this.tamanio  = size;
            this.rotacion = rotation;
            this.galaxia  = galaxia;

            boundingCircle = new BoundingCircle(centro, (float)Math.Sqrt(((tamanio.X / 2.0f) * (tamanio.X / 2.0f) + (tamanio.Y / 2.0f) * (tamanio.Y / 2.0f))));

            galaxia.AgregarThing(this);
        }
示例#2
0
        public override BoundingObject[] CrearBoundingObjects()
        {
            if (boundingObjects == null)
            {
                boundingObjects = new BoundingObject[1];

                boundingObjects[0] = new BoundingCircle(new Vector2(0, 0), Tamanio.X / 2.0f);
            }

            return(boundingObjects);
        }
示例#3
0
        public override bool IntersectsWith(BoundingCircle bc)
        {
            Vector2 vDiff     = bc.center - this.center;
            float   sumRadius = bc.radius + this.radius;

            if (vDiff.LengthSqr <= sumRadius * sumRadius)
            {
                return(true);
            }

            return(false);
        }
示例#4
0
 public override bool IntersectsWith(BoundingCircle bc)
 {
     return(bc.IntersectsWith(this));
 }
示例#5
0
 public abstract bool IntersectsWith(BoundingCircle circle);