17 #ifndef GZ_RENDERING_BASE_BASERAYQUERY_HH_
18 #define GZ_RENDERING_BASE_BASERAYQUERY_HH_
20 #include <gz/math/Matrix4.hh>
21 #include <gz/math/Vector3.hh>
30 inline namespace GZ_RENDERING_VERSION_NAMESPACE {
70 bool _forceSceneUpdate =
true)
override;
95 this->origin = _origin;
109 this->direction = _dir;
116 return this->direction;
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;