Exemplo n.º 1
0
 public XContact(XCollider src, XCollider dst, Vector3 normal, float penetration)
 {
     this.src         = src;
     this.dst         = dst;
     this.normal      = normal;
     this.penetration = penetration;
 }
Exemplo n.º 2
0
 public void AddCollider(XCollider collider)
 {
     // TODO:使用队列,延迟加入。添加和删除碰撞体需要全部延迟到每次update前
     if (collider.rigidbody.IsStatic)
     {
         staticColliders.Add(collider);
     }
     else
     {
         dynamicColliders.Add(collider);
     }
 }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 public void RemoveCollider(XCollider collider)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 5
0
 public abstract bool Intersects(XCollider other, out XContact?contact);