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