34 #ifndef __ENKI_CIRCULARCAM_H 35 #define __ENKI_CIRCULARCAM_H 37 #include "../Interaction.h" 38 #include "../PhysicalEngine.h" 57 virtual void operator()(
double &zBuffer2,
Color &pixelBuffer,
const double &objectDist2,
const Color &objectColor) = 0;
109 CircularCam(
Robot *owner,
Vector pos,
double height,
double orientation,
double halfFieldOfView,
unsigned pixelCount);
112 virtual void init(
double dt,
World* w);
114 virtual void wallsStep(
double dt,
World* w);
115 virtual void finalize(
double dt,
World* w);
118 void setRange(
double range);
126 double interpolateLinear(
double s0,
double s1,
double sv,
double d0,
double d1);
156 OmniCam(
Robot *owner,
double height,
unsigned halfPixelCount);
159 virtual void init(
double dt,
World* w);
161 virtual void wallsStep(
double dt,
World* w);
162 virtual void finalize(
double dt,
World* w);
164 void setRange(
double range);
166 void setFogConditions(
bool useFog,
double density = 0.0,
Color threshold =
Color::black);
A vector in a 2D space.
Definition: Geometry.h:68
std::vector< Color > Texture
A texture.
Definition: Types.h:166
std::valarray< double > zbuffer
zbuffer: distances at square (array of size pixelCount of double)
Definition: CircularCam.h:139
double absOrientation
Absolute angle in the world, updated on init()
Definition: CircularCam.h:77
Point getAbsolutePosition(void)
Return the absolute position (world coordinates) of the camera, updated at each time step on init() ...
Definition: CircularCam.h:120
1D omnidirectional circular camera, based on 2 CircularCam Pixels start at -PI and then follow mathem...
Definition: CircularCam.h:135
A situated object in the world with mass, geometry properties, physical properties, ...
Definition: PhysicalEngine.h:131
static const Color black
black (0, 0, 0)
Definition: Types.h:150
std::valarray< double > zbuffer
zbuffer: distances at square (array of size pixelCount of double)
Definition: CircularCam.h:81
virtual ~OmniCam()
Destructor.
Definition: CircularCam.h:158
Functor for pixel operation.
Definition: CircularCam.h:52
Enki is the namespace of the Enki simulator. All Enki functions and classes excepted the math one are...
Definition: BluetoothBase.cpp:44
double height
Height above ground, the camera will not see any object of smaller height.
Definition: CircularCam.h:73
double getAbsoluteOrientation(void)
Return the absolute orientation (world coordinates) of the camera, updated at each time step on init(...
Definition: CircularCam.h:122
CircularCam cam0
Cameras doing the real job, first part.
Definition: CircularCam.h:145
CircularCam cam1
Cameras doing the real job, second part.
Definition: CircularCam.h:147
virtual ~PixelOperationFunctor()
Virtual destructor, do nothing.
Definition: CircularCam.h:55
Vector absPos
Absolute position in the world, updated on init()
Definition: CircularCam.h:75
std::valarray< Color > image
Image (array of size pixelCount of Color)
Definition: CircularCam.h:141
virtual void operator()(double &zBuffer2, Color &pixelBuffer, const double &objectDist2, const Color &objectColor)=0
Modify the pixel and depth buffer² for a given object color and distance²
PixelOperationFunctor * pixelOperation
Pointer to active pixel operation.
Definition: CircularCam.h:97
The world is the container of all objects and robots.
Definition: PhysicalEngine.h:411
double halfFieldOfView
Field of view = [-halfFieldOfView; + halfFieldOfView]. [0; PI/2].
Definition: CircularCam.h:85
virtual ~CircularCam()
Destructor.
Definition: CircularCam.h:111
Color lightThreshold
Minimum incoming light, otherwise 0. Only used if useFog is true.
Definition: CircularCam.h:94
Vector positionOffset
Position offset based on owner position.
Definition: CircularCam.h:71
double fogDensity
Density of fog, used to compute light attenuation with the function: light = light0 * exp(-fogDensity...
Definition: CircularCam.h:92
A color in RGBA.
Definition: Types.h:55
Interacts with another object or wall only up to a certain distance.
Definition: Interaction.h:53
std::valarray< Color > image
Image (array of size pixelCount of Color)
Definition: CircularCam.h:83
bool useFog
Fog switch, exponential decay of light with distance.
Definition: CircularCam.h:90
A robot is a PhysicalObject that has additional interactions and a controller.
Definition: PhysicalEngine.h:379
double angleOffset
Angular offset based on owner angle.
Definition: CircularCam.h:87
1D Circular camera
Definition: CircularCam.h:67