wheeledexperimenthelper.cpp
47 const wVector centerOnPlane = wall->matrix().w_pos - wall->matrix().z_ax.scale(wall->sideZ() / 2.0);
160 m_vertexes(QVector<wVector>() << computeWallVertex(m_box, 0) << computeWallVertex(m_box, 1) << computeWallVertex(m_box, 2) << computeWallVertex(m_box, 3)),
220 void Box2DWrapper::computeLinearViewFieldOccupiedRange(const wMatrix& cameraMtr, double& minAngle, double& maxAngle, double& distance) const
222 // If this is a Plane or a RectangularTargetArea, we simply return a negative distance (they are not visible with
229 // We have to translate the camera to lie on the same plane of the vertex. We translate it along
230 // its local upvector (Z axis) until it reaches the plane containing the base of the wall. Of course
231 // this only works if the camera Z axis is not paraller to the plane with the base of the wall. In
251 // Now finding the min and max angle (their indexes). We have to take into account the fact that the
252 // angle with the minimum value could be the upper limit and viceversa because the object could be
253 // behind the camera. However we know that, as the camera is outside the wall, the maximum possible
254 // angular sector of the view filed occupied by the wall is 180°. This means that also the angular
255 // distance of one vertex with the center of the wall must be less than 180°. So, if we compute this
256 // distance and get a value greater than 180°, we have to take (360° - computed_angular_distance)
263 // These two are the angular distances of the current min and max angles from the center. Their initial
309 #warning QUESTO MODO DI CALCOLARE LA DISTANZA È SBAGLIATO (E NON NE CAPISCO IL SENSO), MA È QUELLO USATO IN EVOROBOT, QUINDI PER IL MOMENTO LO USO (ANCHE PERCHÉ USARE LA DISTANZA PER L OCCLUSIONE NON VA BENE COMUNQUE)
314 distance = ((mtr.w_pos - m_vertexes[minAngleID]).norm() + (mtr.w_pos - m_vertexes[maxAngleID]).norm()) / 2.0;
320 m_type(((type != SmallCylinder) && (type != BigCylinder) && (type != CircularTargetArea)) ? Cylinder : type)
367 void Cylinder2DWrapper::computeLinearViewFieldOccupiedRange(const wMatrix& cameraMtr, double& minAngle, double& maxAngle, double& distance) const
369 // If this is a CircularTargetArea, we simply return a negative distance (it is not visible with
376 // The center of the lower base of the cylinder. The local x axis points towards the ground (cylinders
378 const wVector baseCenter = m_cylinder->matrix().w_pos + m_cylinder->matrix().x_ax.scale(m_cylinder->height() / 2.0);
380 // We have to translate the camera to lie on the same plane of the cylinder base. We translate it along
381 // its local upvector (Z axis) until it reaches the plane containing the base of the cylinder. Of course