Glare.Plane3f.Intersect C# (CSharp) Method

Intersect() public method

Get the intersection point between the three planes.
public Intersect ( Plane3f b, Plane3f c ) : Vector3f
b Plane3f
c Plane3f
return Vector3f
        public Vector3f Intersect( Plane3f b,  Plane3f c )
        {
            Vector3f result;
                    Vector3f v1, v2, v3;
                    Vector3f cross;

                    b.Normal.Cross(ref c.Normal, out cross);

                    var f = -Normal.Dot(ref cross);

                    v1 = cross *  Distance ;

                    c.Normal.Cross(ref Normal, out cross);
                    v2 = cross *  b.Distance ;

                    Normal.Cross(ref b.Normal, out cross);
                    v3 = cross *  c.Distance ;

                    result.X = (Single)( (v1.X + v2.X + v3.X) / f );
                    result.Y = (Single)( (v1.Y + v2.Y + v3.Y) / f );
                    result.Z = (Single)( (v1.Z + v2.Z + v3.Z) / f );

                    return result;
        }

Same methods

Plane3f::Intersect ( Plane3f &b, Plane3f &c, Vector3f &result ) : void