Exemplo n.º 1
0
 internal void OnCollisionEnd(SCollisionResult res)
 {
     if (isAlive)
     {
         foreach (var i in _componentList)
         {
             i.Value.OnCollisionEnd(res);
         }
     }
 }
Exemplo n.º 2
0
 protected override bool GenerateCollisionRes(SICollider other, out SCollisionResult selfres, out SCollisionResult otherres)
 {
     if (other.GetType().Equals(typeof(SSphereCollider)))
     {
         var minDis = (other.position - position).sqrtMagnitude;
         if (minDis <= (radius + other.radius) * (radius + other.radius))
         {
             //SDebug.LogWarning(gameObject.name + " BAAAAAANG!!!  " + minDis);
         }
     }
     else if (other.GetType().Equals(typeof(SCapsuleCollider)))
     {
         var   oth    = other as SCapsuleCollider;
         Fix64 minDis = Fix64.MaxValue;
         var   atop   = position - oth.positionA;
         var   btop   = position - oth.positionB;
         var   ti     = atop.Dot(oth.up);
         var   tj     = btop.Dot(oth.up);
         var   w      = position - oth.positionA;
         if (ti * tj < Fix64.Zero)
         {
             minDis = w.sqrtMagnitude - w.Dot(oth.up) * w.Dot(up);
         }
         else if (ti <= Fix64.Zero)
         {
             minDis = atop.sqrtMagnitude;
         }
         else if (tj >= Fix64.Zero)
         {
             minDis = btop.sqrtMagnitude;
         }
         if (minDis <= (radius + other.radius) * (radius + other.radius))
         {
             SDebug.LogWarning(gameObject.name + " BAAAAAANG!!!  " + minDis);
         }
     }
     selfres  = new SCollisionResult();
     otherres = new SCollisionResult();
     return(false);
 }
Exemplo n.º 3
0
 protected void handleResult(SCollisionResult res)
 {
 }
Exemplo n.º 4
0
 protected override bool GenerateCollisionRes(SICollider other, out SCollisionResult selfres, out SCollisionResult otherres)
 {
     selfres  = new SCollisionResult();
     otherres = new SCollisionResult();
     return(false);
 }
Exemplo n.º 5
0
 protected abstract bool GenerateCollisionRes(SICollider other, out SCollisionResult selfres, out SCollisionResult otherres);
Exemplo n.º 6
0
 public virtual void OnCollisionEnd(SCollisionResult res)
 {
 }
Exemplo n.º 7
0
 public virtual void OnCollisionStay(SCollisionResult res)
 {
 }