The graphical representation of the linear camera. More...

Public Member Functions | |
LinearCameraGraphic (WObject *object, const wMatrix &transformation, double minAngle, double maxAngle, unsigned int numReceptors, QString name="unamed") | |
Constructor. | |
~LinearCameraGraphic () | |
Destructor. | |
void | setPerceivedColors (const QVector< QColor > &receptors) |
Sets the colors perceived by the camera. | |
![]() | |
GraphicalWObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity()) | |
WObject * | attachedObject () const |
void | attachToObject (WObject *object, bool makeOwner=false) |
QColor | color () const |
bool | isInvisible () |
const wMatrix & | matrix () const |
QString | name () const |
Ownable () | |
const QList< Owned > & | owned () const |
Ownable * | owner () const |
virtual void | postUpdate () |
virtual void | preUpdate () |
void | setAlpha (int alpha) |
void | setColor (QColor c) |
void | setInvisible (bool b) |
void | setMatrix (const wMatrix &newm) |
void | setOwner (Ownable *owner, bool destroy=true) |
void | setPosition (real x, real y, real z) |
void | setPosition (const wVector &newpos) |
void | setTexture (QString textureName) |
void | setUseColorTextureOfOwner (bool b) |
QString | texture () const |
void | updateAndCalculateAABB (wVector &minPoint, wVector &maxPoint, const wMatrix tm) |
void | updateAndCalculateOBB (wVector &dimension, wVector &minPoint, wVector &maxPoint) |
void | updateAndRender (RenderWObject *renderer, QGLContext *gw) |
void | updateAndRenderAABB (RenderWObject *renderer, RenderWorld *gw) |
bool | useColorTextureOfOwner () const |
WObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity(), bool addToWorld=true) | |
const World * | world () const |
World * | world () |
![]() | |
WObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity(), bool addToWorld=true) | |
QColor | color () const |
bool | isInvisible () |
const wMatrix & | matrix () const |
QString | name () const |
Ownable () | |
const QList< Owned > & | owned () const |
Ownable * | owner () const |
void | setAlpha (int alpha) |
void | setColor (QColor c) |
void | setInvisible (bool b) |
void | setMatrix (const wMatrix &newm) |
void | setOwner (Ownable *owner, bool destroy=true) |
void | setPosition (const wVector &newpos) |
void | setPosition (real x, real y, real z) |
void | setTexture (QString textureName) |
void | setUseColorTextureOfOwner (bool b) |
QString | texture () const |
bool | useColorTextureOfOwner () const |
World * | world () |
const World * | world () const |
![]() | |
const QList< Owned > & | owned () const |
Ownable * | owner () const |
void | setOwner (Ownable *owner, bool destroy=true) |
Protected Member Functions | |
virtual void | render (RenderWObject *renderer, QGLContext *gw) |
Performs the actual drawing. | |
![]() | |
virtual void | calculateAABB (wVector &minPoint, wVector &maxPoint, const wMatrix tm) |
virtual void | calculateOBB (wVector &dimension, wVector &minPoint, wVector &maxPoint) |
virtual void | changedMatrix () |
virtual void | renderAABB (RenderWObject *renderer, RenderWorld *gw) |
void | updateMatrixFromAttachedObject () |
Protected Attributes | |
const double | m_maxAngle |
The maximum angle of the camera. | |
const double | m_minAngle |
The minimum angle of the camera. | |
const unsigned int | m_numReceptors |
The number of receptors. | |
WObject *const | m_object |
The object to which we are attached. | |
const double | m_receptorRange |
The range of each receptor. | |
QVector< QColor > | m_receptors |
The vector with perceived colors. | |
QMutex | m_receptorsMutex |
The mutex protecting the m_receptors variable. | |
const wMatrix | m_transformation |
The transformation matrix relative the one of the object to which we are attached. | |
![]() | |
QColor | colorv |
bool | invisible |
WObject * | m_attachedObject |
QString | namev |
QString | texturev |
wMatrix | tm |
bool | usecolortextureofowner |
World * | worldv |
![]() | |
QColor | colorv |
bool | invisible |
QString | namev |
QString | texturev |
wMatrix | tm |
bool | usecolortextureofowner |
World * | worldv |
Additional Inherited Members | |
![]() | |
typedef QList< Owned > | OwnedList |
Detailed Description
The graphical representation of the linear camera.
Definition at line 154 of file sensors.cpp.
Constructor & Destructor Documentation
|
inline |
Constructor.
This also sets the object to be our owner
- Parameters
-
object the object to which we are attached. transformation the transformation matrix relative the one of the object to which we are attached minAngle the minimum angle of the camera maxAngle the maximum angle of the camera numReceptors the number of receptors name the name of this object
Definition at line 170 of file sensors.cpp.
References GraphicalWObject::attachToObject(), LinearCameraGraphic::m_object, GraphicalWObject::setColor(), GraphicalWObject::setTexture(), and GraphicalWObject::setUseColorTextureOfOwner().
|
inline |
Destructor.
Definition at line 192 of file sensors.cpp.
Member Function Documentation
|
inlineprotectedvirtual |
Performs the actual drawing.
- Parameters
-
renderer the RenderWObject object associated with this one. Use it e.g. to access the container gw the OpenGL context
Implements GraphicalWObject.
Definition at line 217 of file sensors.cpp.
References RenderWObject::container(), LinearCameraGraphic::m_minAngle, LinearCameraGraphic::m_numReceptors, LinearCameraGraphic::m_receptorRange, LinearCameraGraphic::m_receptors, LinearCameraGraphic::m_receptorsMutex, LinearCameraGraphic::m_transformation, RenderWObjectContainer::setupColorTexture(), and GraphicalWObject::tm.
|
inline |
Sets the colors perceived by the camera.
This function is thread-safe
- Parameters
-
receptors the colors perceived by receptors
Definition at line 202 of file sensors.cpp.
References LinearCameraGraphic::m_receptors, and LinearCameraGraphic::m_receptorsMutex.
Referenced by LinearCamera::update().
Member Data Documentation
|
protected |
The maximum angle of the camera.
Definition at line 376 of file sensors.cpp.
|
protected |
The minimum angle of the camera.
Definition at line 371 of file sensors.cpp.
Referenced by LinearCameraGraphic::render().
|
protected |
The number of receptors.
Definition at line 381 of file sensors.cpp.
Referenced by LinearCameraGraphic::render().
|
protected |
The object to which we are attached.
Definition at line 360 of file sensors.cpp.
Referenced by LinearCameraGraphic::LinearCameraGraphic().
|
protected |
The range of each receptor.
This is computed in the constructor.
Definition at line 388 of file sensors.cpp.
Referenced by LinearCameraGraphic::render().
|
protected |
The vector with perceived colors.
Definition at line 393 of file sensors.cpp.
Referenced by LinearCameraGraphic::render(), and LinearCameraGraphic::setPerceivedColors().
|
protected |
The mutex protecting the m_receptors variable.
The variable could be accessed by multiple threads concurrently, so we protect it with a mutex
Definition at line 401 of file sensors.cpp.
Referenced by LinearCameraGraphic::render(), and LinearCameraGraphic::setPerceivedColors().
|
protected |
The transformation matrix relative the one of the object to which we are attached.
Definition at line 366 of file sensors.cpp.
Referenced by LinearCameraGraphic::render().
The documentation for this class was generated from the following file:
- experiments/src/sensors.cpp