예제 #1
0
파일: Ray.cs 프로젝트: ukitake/Stratum
 public override bool Test(Plane other)
 {
     return sray.Intersects(ref other.splane);
 }
예제 #2
0
        public static bool Test(LineSegment seg, Plane plane)
        {
            Vector3 q;
            float t;

            // Compute the t value for the directed line ab intersecting the plane
            Vector3 ab = seg.Point2 - seg.Point1;
            t = (plane.D - Vector3.Dot(plane.Normal, seg.Point1)) / Vector3.Dot(plane.Normal, ab);

            // If t in [0..1] compute and return intersection point
            if (t >= 0.0f && t <= 1.0f)
            {
                q = seg.Point1 + t * ab;
                return true;
            }
            // Else no intersection
            return false;
        }
예제 #3
0
파일: Cylinder.cs 프로젝트: ukitake/Stratum
 public override bool Test(Plane other)
 {
     throw new NotImplementedException();
 }
예제 #4
0
 public override bool Test(Plane other)
 {
     return IntersectionTests.Test(this, other);
 }
예제 #5
0
파일: Line.cs 프로젝트: ukitake/Stratum
 public override bool Test(Plane other)
 {
     return rp.Intersects(ref other.splane) || rn.Intersects(ref other.splane);
 }
예제 #6
0
 public abstract bool Test(Plane other);
예제 #7
0
 public override bool Test(Plane other)
 {
     return sbf.Intersects(ref other.splane) == PlaneIntersectionType.Intersecting;
 }
예제 #8
0
파일: Triangle.cs 프로젝트: ukitake/Stratum
 public override bool Test(Plane other)
 {
     return Collision.PlaneIntersectsTriangle(ref other.splane, ref P1, ref P2, ref P3) == PlaneIntersectionType.Intersecting;
 }