All pastes #1571667 Raw Edit

Untitled

public text v1 · immutable
#1571667 ·published 2009-09-19 10:07 UTC
rendered paste body
btVector3 PlaneLineIntersection(const btPlane &plane, const btVector3 &p0, const btVector3 &p1)
{
        // returns the point where the line p0-p1 intersects the plane n&d
                                static btVector3 dif;
                dif = p1-p0;
                                btScalar dn= btDot(plane.normal,dif);
                                btScalar t = -(plane.dist+btDot(plane.normal,p0) )/dn;
                                return p0 + (dif*t);
}