Пример #1
0
 public XContact(XCollider src, XCollider dst, Vector3 normal, float penetration)
 {
     this.src         = src;
     this.dst         = dst;
     this.normal      = normal;
     this.penetration = penetration;
 }
Пример #2
0
 public void AddCollider(XCollider collider)
 {
     // TODO:使用队列,延迟加入。添加和删除碰撞体需要全部延迟到每次update前
     if (collider.rigidbody.IsStatic)
     {
         staticColliders.Add(collider);
     }
     else
     {
         dynamicColliders.Add(collider);
     }
 }
Пример #3
0
 public override bool Intersects(XCollider other, out XContact?contact)
 {
     if (other is CubeXCollider)
     {
         return(ColliderIntersectHelper.Intersect(this, (CubeXCollider)other, out contact));
     }
     if (other is CylinderXCollider)
     {
         return(ColliderIntersectHelper.Intersect(this, (CylinderXCollider)other, out contact));
     }
     if (other is SphereXCollider)
     {
         return(ColliderIntersectHelper.Intersect(this, (SphereXCollider)other, out contact));
     }
     contact = null;
     return(false);
 }
Пример #4
0
 public void RemoveCollider(XCollider collider)
 {
     throw new System.NotImplementedException();
 }
Пример #5
0
 public abstract bool Intersects(XCollider other, out XContact?contact);