コード例 #1
0
ファイル: PEPlane.cpp プロジェクト: rocket99/PEEngine
PELine3D PEPlane::reflectLine(const PELine3D &line)
{
    P3D P0 = this->crossPoint(line);//交点
    
    V3D n0 = m_normal.normal();
    V3D in = line.Direct().normal();
    if (dot(n0, in) < 0.0) {
        in = -1.0f * in;
    }
    V3D out = 2.0 * dot(n0, in)*n0 - in;
    return PELine3D(out.normal(), P0.x, P0.y, P0.z);
}