|
Enki
1.9
|
1D Circular camera More...
#include <CircularCam.h>
Public Member Functions | |
| CircularCam (Robot *owner, Vector pos, double height, double orientation, double halfFieldOfView, unsigned pixelCount) | |
| Constructor. More... | |
| virtual | ~CircularCam () |
| Destructor. | |
| virtual void | init (double dt, World *w) |
| Init at each step. | |
| virtual void | objectStep (double dt, World *w, PhysicalObject *po) |
| Interact with object. More... | |
| virtual void | wallsStep (double dt, World *w) |
| Interact with walls. More... | |
| virtual void | finalize (double dt, World *w) |
| Finalize at each step. | |
| void | setRange (double range) |
| Change the sight range of the camera. | |
| Point | getAbsolutePosition (void) |
| Return the absolute position (world coordinates) of the camera, updated at each time step on init() | |
| double | getAbsoluteOrientation (void) |
| Return the absolute orientation (world coordinates) of the camera, updated at each time step on init() | |
Public Member Functions inherited from Enki::LocalInteraction | |
| LocalInteraction () | |
| Constructor. | |
| LocalInteraction (double range, Robot *owner) | |
| Constructor. | |
| virtual | ~LocalInteraction () |
| Destructor. | |
| double | getRange () const |
| Return the range of the interaction. | |
Public Attributes | |
| std::valarray< double > | zbuffer |
| zbuffer: distances at square (array of size pixelCount of double) | |
| std::valarray< Color > | image |
| Image (array of size pixelCount of Color) | |
| double | halfFieldOfView |
| Field of view = [-halfFieldOfView; + halfFieldOfView]. [0; PI/2]. | |
| double | angleOffset |
| Angular offset based on owner angle. | |
| bool | useFog |
| Fog switch, exponential decay of light with distance. | |
| double | fogDensity |
| Density of fog, used to compute light attenuation with the function: light = light0 * exp(-fogDensity * distance) | |
| Color | lightThreshold |
| Minimum incoming light, otherwise 0. Only used if useFog is true. | |
| PixelOperationFunctor * | pixelOperation |
| Pointer to active pixel operation. | |
Protected Member Functions | |
| double | interpolateLinear (double s0, double s1, double sv, double d0, double d1) |
| Return linear interpolated value between d0 and d1, given a sensorvalue sv between s0 and s1. | |
| void | drawTexturedLine (const Point &p0, const Point &p1, const Texture &texture) |
| Draw a textured line from point p0 to p1 using texture - WTF are p0 and p1?? | |
Protected Attributes | |
| Vector | positionOffset |
| Position offset based on owner position. | |
| double | height |
| Height above ground, the camera will not see any object of smaller height. | |
| Vector | absPos |
| Absolute position in the world, updated on init() | |
| double | absOrientation |
| Absolute angle in the world, updated on init() | |
Protected Attributes inherited from Enki::LocalInteraction | |
| double | r |
| Radius of the local interaction. | |
| Robot * | owner |
| The physical object that owns the interaction. | |
1D Circular camera
The maximum aperture angle of this camera is PI, so this is not an omnicam. Pixels start at -halfFieldOfView and then follow mathematical orientation
| Enki::CircularCam::CircularCam | ( | Robot * | owner, |
| Vector | pos, | ||
| double | height, | ||
| double | orientation, | ||
| double | halfFieldOfView, | ||
| unsigned | pixelCount | ||
| ) |
Constructor.
| owner | robot this camera is attached to |
| pos | position of this camera on the robot |
| height | height of this camera with respect to ground |
| orientation | orientation of this camera with respect to the robot front |
| halfFieldOfView | half aperture of the camera. The real field of view is twice this value [0; PI/2] |
| pixelCount | number of pixel to cover the full field of view |
References angleOffset, Enki::Color::black, Enki::depthTest, fogDensity, halfFieldOfView, height, lightThreshold, Enki::LocalInteraction::owner, pixelOperation, positionOffset, Enki::LocalInteraction::r, and useFog.
|
virtual |
Interact with object.
| dt | time step |
| po | object to interact with |
| w | world where the interaction takes place |
Reimplemented from Enki::LocalInteraction.
References absOrientation, absPos, Enki::Vector::angle(), drawTexturedLine(), halfFieldOfView, height, image, Enki::Vector::norm(), Enki::normalizeAngle(), Enki::PhysicalObject::pos, and zbuffer.
Referenced by Enki::OmniCam::objectStep().
|
virtual |
Interact with walls.
| w | world to which interact |
Reimplemented from Enki::LocalInteraction.
References Enki::World::color, drawTexturedLine(), Enki::World::h, Enki::LocalInteraction::r, Enki::World::r, Enki::World::w, Enki::World::WALLS_CIRCULAR, Enki::World::WALLS_SQUARE, and Enki::World::wallsType.
Referenced by Enki::OmniCam::wallsStep().
1.8.11