7 #ifndef CAMERAS_SENSOR_ALGORITHM_H
8 #define CAMERAS_SENSOR_ALGORITHM_H
11 class CCameraSensorSimulatedAlgorithm;
14 #include <argos3/core/utility/plugins/factory.h>
15 #include <argos3/core/utility/math/vector3.h>
16 #include <argos3/core/utility/math/plane.h>
17 #include <argos3/core/utility/math/matrix/transformationmatrix3.h>
18 #include <argos3/core/simulator/entity/positional_entity.h>
32 const std::array<CPlane, 6>& arr_frustum_planes,
47 return ACos(fDotProduct / (cEntityDirection.
Length() * cEntityToCamera.
Length()));
54 cCameraToEntityTranslationMatrix(0,0) =
55 cCameraToEntityTranslation.
GetX() / cCameraToEntityTranslation.
GetZ();
56 cCameraToEntityTranslationMatrix(1,0) =
57 cCameraToEntityTranslation.
GetY() / cCameraToEntityTranslation.
GetZ();
58 cCameraToEntityTranslationMatrix(2,0) = 1.0f;
62 return CVector2(cImageCoordinates(0,0), cImageCoordinates(1,0));
67 if(c_plane.GetNormal().DotProduct(c_point - c_plane.GetPosition()) < 0.0) {
87 const std::array<CPlane, 6>& arr_frustum_planes,
90 const CVector3& c_bounding_box_position,
91 const CVector3& c_bounding_box_half_extents) = 0;
104 #define REGISTER_CAMERA_SENSOR_ALGORITHM(CLASSNAME, \
111 REGISTER_SYMBOL(CCameraSensorSimulatedAlgorithm, \
float Real
Collects all ARGoS code.
The namespace containing all the ARGoS related code.
CRadians ACos(Real f_value)
Computes the arccosine of the passed value.
const CQuaternion & GetOrientation() const
const CVector3 & GetPosition() const
It defines the basic type CRadians, used to store an angle value in radians.
Real Length() const
Returns the length of this vector.
CVector3 & Rotate(const CQuaternion &c_quaternion)
Rotates this vector by the given quaternion.
Real GetX() const
Returns the x coordinate of this vector.
Real DotProduct(const CVector3 &c_vector3) const
Returns the dot product between this vector and the passed one.
Real GetY() const
Returns the y coordinate of this vector.
static const CVector3 Z
The z axis.
Real GetZ() const
Returns the z coordinate of this vector.
std::vector< std::pair< bool, CRay3 > > m_vecCheckedRays
virtual ~CCameraSensorSimulatedAlgorithm()
const std::vector< std::pair< bool, CRay3 > > & GetCheckedRays() const
virtual void Update(const CSquareMatrix< 3 > &c_projection_matrix, const std::array< CPlane, 6 > &arr_frustum_planes, const CTransformationMatrix3 &c_world_to_camera_transform, const CVector3 &c_camera_location, const CVector3 &c_bounding_box_position, const CVector3 &c_bounding_box_half_extents)=0
CRadians GetAngleWithCamera(const CPositionalEntity &c_entity) const
CBaseUpdateOperation(const CSquareMatrix< 3 > &c_projection_matrix, const std::array< CPlane, 6 > &arr_frustum_planes, const CTransformationMatrix3 &c_camera_to_world_transform, const CVector3 &c_camera_location)
const CVector3 & m_cCameraLocation
const CSquareMatrix< 3 > & m_cProjectionMatrix
const CTransformationMatrix3 & m_cCameraToWorldTransform
const std::array< CPlane, 6 > & m_arrFrustumPlanes
CVector2 ProjectOntoSensor(const CVector3 &c_vector) const
bool IsPointInsideFrustum(const CVector3 &c_point) const
virtual ~CBaseUpdateOperation()