public void Contains(BoundingSphere other, out ContainmentType ct) { if (other == null) ct = ContainmentType.Disjoint; else ct = sbf.Contains(ref other.sSphere); }
public static BoundingSphere Merge(BoundingSphere first, BoundingSphere second) { if (first == null && second != null) return second; if (second == null && first != null) return first; return new BoundingSphere(SharpDX.BoundingSphere.Merge(first.sSphere, second.sSphere)); }
public static bool Test(BoundingSphere s0, BoundingSphere s1, Vector3 v0, Vector3 v1, out float t) { // expand sphere s1 by the radius of s0 s1.Radius += s0.Radius; // subtract movement of s1 from both s0 and s1, making s1 stationary Vector3 v = v0 - v1; // can now test directed segment s = s0.Center + v*t, v = (v0 - v1)/||v0 - v1|| against the expanded sphere for intersection float vlen = v.Length(); SharpDX.Ray s = new SharpDX.Ray(s0.Center, v / vlen); if (s1.sSphere.Intersects(ref s, out t)) return t <= vlen; return false; }
public abstract bool Test(BoundingSphere other);
public override BoundingVolume Merge(BoundingSphere other) { throw new NotImplementedException(); }
public ContainmentType Contains(BoundingSphere other) { return sbf.Contains(ref other.sSphere); }
public override bool Test(BoundingSphere other) { return(IntersectionTests.Test(this, other)); }
public override bool Test(BoundingSphere other) { throw new NotImplementedException(); }
public static bool Test(BoundingSphere sphere, Vector3 a, Vector3 b, Vector3 c) { // Find point P on triangle ABC closest to sphere center Vector3 p = ClosestPoint.Find(sphere.Center, a, b, c); // Sphere and triangle intersect if the (squared) distance from sphere // center to point p is less than the (squared) sphere radius Vector3 v = p - sphere.Center; return Vector3.Dot(v, v) <= sphere.Radius * sphere.Radius; }
public override BoundingVolume Merge(BoundingSphere other) { return BoundingSphere.Merge(this, other); }
public override bool TestMoving(BoundingSphere other, Vector3 v0, Vector3 v1, out float t) { return DynamicIntersectionTests.Test(this, other, v0, v1, out t); }
public override bool Test(BoundingSphere other) { return Collision.SphereIntersectsTriangle(ref other.sSphere, ref P1, ref P2, ref P3); }
public override BoundingVolume Merge(BoundingSphere other) { var otherB = SharpDX.BoundingBox.FromSphere(other.sSphere); return new AxisAlignedBoundingBox(SharpDX.BoundingBox.Merge(this.sbb, otherB)); }
public static AxisAlignedBoundingBox FromSphere(BoundingSphere sphere) { return new AxisAlignedBoundingBox(BoundingBox.FromSphere(sphere.sSphere)); }
public override bool Test(BoundingSphere other) { return splane.Intersects(ref other.sSphere) == PlaneIntersectionType.Intersecting; }
public override bool Test(BoundingSphere other) { return IntersectionTests.Test(this, other); }
public static bool Test(LineSegment seg, BoundingSphere sphere) { ContainmentType ct1 = sphere.Contains(seg.Point1); ContainmentType ct2 = sphere.Contains(seg.Point2); return ct1 != ct2; }
public abstract BoundingVolume Merge(BoundingSphere other);
public abstract bool TestMoving(BoundingSphere other, Vector3 v0, Vector3 v1, out float t);
public override bool TestMoving(BoundingSphere other, Vector3 v0, Vector3 v1, out float t) { throw new NotImplementedException(); }
public override bool Test(BoundingSphere other) { return sray.Intersects(ref other.sSphere); }
public override bool Test(BoundingSphere other) { return(rp.Intersects(ref other.sSphere) || rn.Intersects(ref other.sSphere)); }