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

Inheritance diagram for LinearCameraGraphic:

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.
 
- Public Member Functions inherited from GraphicalWObject
 GraphicalWObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity())
 
WObjectattachedObject () const
 
void attachToObject (WObject *object, bool makeOwner=false)
 
QColor color () const
 
bool isInvisible ()
 
const wMatrixmatrix () const
 
QString name () const
 
 Ownable ()
 
const QList< Owned > & owned () const
 
Ownableowner () 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 Worldworld () const
 
Worldworld ()
 
- Public Member Functions inherited from WObject
 WObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity(), bool addToWorld=true)
 
QColor color () const
 
bool isInvisible ()
 
const wMatrixmatrix () const
 
QString name () const
 
 Ownable ()
 
const QList< Owned > & owned () const
 
Ownableowner () 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
 
Worldworld ()
 
const Worldworld () const
 
- Public Member Functions inherited from Ownable
const QList< Owned > & owned () const
 
Ownableowner () const
 
void setOwner (Ownable *owner, bool destroy=true)
 

Protected Member Functions

virtual void render (RenderWObject *renderer, QGLContext *gw)
 Performs the actual drawing.
 
- Protected Member Functions inherited from GraphicalWObject
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.
 
- Protected Attributes inherited from GraphicalWObject
QColor colorv
 
bool invisible
 
WObjectm_attachedObject
 
QString namev
 
QString texturev
 
wMatrix tm
 
bool usecolortextureofowner
 
Worldworldv
 
- Protected Attributes inherited from WObject
QColor colorv
 
bool invisible
 
QString namev
 
QString texturev
 
wMatrix tm
 
bool usecolortextureofowner
 
Worldworldv
 

Additional Inherited Members

- Public Types inherited from GraphicalWObject
typedef QList< OwnedOwnedList
 

Detailed Description

The graphical representation of the linear camera.

Definition at line 154 of file sensors.cpp.

Constructor & Destructor Documentation

LinearCameraGraphic ( WObject object,
const wMatrix transformation,
double  minAngle,
double  maxAngle,
unsigned int  numReceptors,
QString  name = "unamed" 
)
inline

Constructor.

This also sets the object to be our owner

Parameters
objectthe object to which we are attached.
transformationthe transformation matrix relative the one of the object to which we are attached
minAnglethe minimum angle of the camera
maxAnglethe maximum angle of the camera
numReceptorsthe number of receptors
namethe 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().

~LinearCameraGraphic ( )
inline

Destructor.

Definition at line 192 of file sensors.cpp.

Member Function Documentation

virtual void render ( RenderWObject renderer,
QGLContext *  gw 
)
inlineprotectedvirtual
void setPerceivedColors ( const QVector< QColor > &  receptors)
inline

Sets the colors perceived by the camera.

This function is thread-safe

Parameters
receptorsthe 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

const double m_maxAngle
protected

The maximum angle of the camera.

Definition at line 376 of file sensors.cpp.

const double m_minAngle
protected

The minimum angle of the camera.

Definition at line 371 of file sensors.cpp.

Referenced by LinearCameraGraphic::render().

const unsigned int m_numReceptors
protected

The number of receptors.

Definition at line 381 of file sensors.cpp.

Referenced by LinearCameraGraphic::render().

WObject* const m_object
protected

The object to which we are attached.

Definition at line 360 of file sensors.cpp.

Referenced by LinearCameraGraphic::LinearCameraGraphic().

const double m_receptorRange
protected

The range of each receptor.

This is computed in the constructor.

Definition at line 388 of file sensors.cpp.

Referenced by LinearCameraGraphic::render().

QVector<QColor> m_receptors
protected

The vector with perceived colors.

Definition at line 393 of file sensors.cpp.

Referenced by LinearCameraGraphic::render(), and LinearCameraGraphic::setPerceivedColors().

QMutex m_receptorsMutex
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().

const wMatrix m_transformation
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: