예제 #1
0
 public override bool DetectCollision(float sourceRadius, Vector3 sourceLocation)
 {
     if (mExplosionType == eExplosionType.eCIRCLE)
     {
         //LogHelper.LogInfo($"circle {MathHelpers.circlesColliding(sourceLocation.x, sourceLocation.z, sourceRadius, this.GetLocation().x, this.GetLocation().z, this.GetCollisionRadius())}");
         return(MathHelpers.circlesColliding(sourceLocation.x, sourceLocation.z, sourceRadius, this.GetLocation().x, this.GetLocation().z, this.GetCollisionRadius()));
     }
     else
     {
         //LogHelper.LogInfo($"rect {MathHelpers.circleRect(sourceLocation.x, sourceLocation.z, sourceRadius, this.rx, this.ry, this.rw, this.rh)}");
         return(MathHelpers.circleRect(sourceLocation.x, sourceLocation.z, sourceRadius, this.rx, this.ry, this.rw, this.rh));
     }
 }
예제 #2
0
 public virtual bool DetectCollision(float sourceRadius, Vector3 sourceLocation)
 {
     return(MathHelpers.circleRect(sourceLocation.x, sourceLocation.z, sourceRadius, this.rx, this.ry, this.rw, this.rh));
 }