128 math::Matrix4d viewProjInv = (projectionMatrix * viewMatrix).Inverse();
133 double startw = viewProjInv(3, 0) * start[0] +
134 viewProjInv(3, 1) * start[1] +
135 viewProjInv(3, 2) * start[2] + viewProjInv(3, 3);
136 double endw = viewProjInv(3, 0) * end[0] +
137 viewProjInv(3, 1) * end[1] +
138 viewProjInv(3, 2) * end[2] + viewProjInv(3, 3);
139 start = viewProjInv * start;
140 end = viewProjInv * end;
142 start = start / startw;
146 this->origin = start;
147 this->direction = dir;