The graphical representation of the single IR sensor. More...
Public Member Functions | |
SingleIRGraphic (WObject *object, const wMatrix &offset, const QVector< wVector > &startingRayPoints, const QVector< wVector > &endingRayPoints, bool drawRay, bool drawRealRay, QString name="unamed") | |
Constructor. | |
~SingleIRGraphic () | |
Destructor. | |
Public Member Functions inherited from GraphicalWObject | |
GraphicalWObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity()) | |
Constructor. | |
virtual | ~GraphicalWObject () |
Destructor. | |
WObject * | attachedObject () const |
The object to which we are attached. | |
void | attachToObject (WObject *object, bool makeOwner=false, const wMatrix &displacement=wMatrix::identity()) |
Attaches this object to another WObject. | |
const wMatrix & | getDisplacement () const |
Returns the displacement matrix relative to the object to which we are attached. | |
void | setDisplacement (const wMatrix &displacement) |
Sets the displacement matrix relative to the object to which we are attached. | |
void | updateAndCalculateAABB (wVector &minPoint, wVector &maxPoint, const wMatrix tm) |
Returns the min and max points of the Axis-Aligned Bounding Box (AABB) | |
void | updateAndCalculateOBB (wVector &dimension, wVector &minPoint, wVector &maxPoint) |
Returns the dimension of the Oriented Bounding Box (OBB) in the object local frame. | |
void | updateAndRender (RenderWObject *renderer, QGLContext *gw) |
Performs the actual drawing. | |
void | updateAndRenderAABB (RenderWObject *renderer, RenderWorld *gw) |
The function rendering the Axis-Aligned Bounding Box (AABB) | |
Public Member Functions inherited from WObject | |
WObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity(), bool addToWorld=true) | |
create the object and automatically put this into the world | |
virtual | ~WObject () |
destroy the Object and drop it from the world | |
QColor | color () const |
return the color of this object | |
bool | isInvisible () |
return if it is invisible | |
const wMatrix & | matrix () const |
return a reference to the transformation matrix | |
QString | name () const |
Return the name of this object. | |
virtual void | postUpdate () |
postUpdate the WObject this method is called at each step of the world just after the physic update | |
virtual void | preUpdate () |
preUpdate the WObject this method is called at each step of the world just before the physic update | |
void | setAlpha (int alpha) |
set the value of alpha channel (the transparency) | |
void | setColor (QColor c) |
Set the color to use on rendering. | |
void | setInvisible (bool b) |
set invisibility | |
void | setMatrix (const wMatrix &newm) |
set a new matrix | |
void | setPosition (const wVector &newpos) |
set the position specified in global coordinate frame | |
void | setPosition (real x, real y, real z) |
set the position specified in global coordinate frame | |
void | setTexture (QString textureName) |
Set the texture to use for this WObject when rendered. | |
void | setUseColorTextureOfOwner (bool b) |
set if the object will be rendered with the color and texture of our owner (if we have one) | |
QString | texture () const |
Return the texture name. | |
bool | useColorTextureOfOwner () const |
if true, we will use color and texture of our owner (if we have one) | |
World * | world () |
Return the world. | |
const World * | world () const |
Return the world (const version) | |
Public Member Functions inherited from Ownable | |
Ownable () | |
Constructor. | |
virtual | ~Ownable () |
Destructor. | |
const QList< Owned > & | owned () const |
Returns the list of objects owned by this one. | |
Ownable * | owner () const |
Returns the owner of this object. | |
void | setOwner (Ownable *owner, bool destroy=true) |
Sets the owner of this object. | |
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) |
Returns the min and max points of the Axis-Aligned Bounding Box (AABB) | |
virtual void | calculateOBB (wVector &dimension, wVector &minPoint, wVector &maxPoint) |
Returns the dimension of the Oriented Bounding Box (OBB) in the object local frame If there is no meaningful OBB, set dimension, minPoint and maxPoint to (0, 0, 0), as the default implementation does. | |
virtual void | renderAABB (RenderWObject *renderer, RenderWorld *gw) |
The function rendering the Axis-Aligned Bounding Box (AABB) | |
void | updateMatrixFromAttachedObject () |
Updates the transformation matrix from the object to which we are attached (if there is one) | |
Protected Member Functions inherited from WObject | |
virtual void | changedMatrix () |
virtual function called when the transformation matrix change | |
Protected Attributes | |
const bool | m_drawRay |
If true a red segments giving the direction of the sensor rays are drawn. | |
const bool | m_drawRealRay |
Whether to draw the actual ray lengths or not. | |
const QVector< wVector > | m_endingRayPoints |
The vector with ending points of the rays. | |
WObject *const | m_object |
The object to which this graphicalc representation is attached. | |
const wMatrix | m_offset |
The displacement matrix relative to the object to which we are attached. | |
const QVector< wVector > | m_startingRayPoints |
The vector with starting points of the rays. | |
Additional Inherited Members | |
Public Types inherited from Ownable | |
typedef QList< Owned > | OwnedList |
The type for the list of owned objects. | |
Detailed Description
The graphical representation of the single IR sensor.
Definition at line 74 of file sensorcontrollers.cpp.
Constructor & Destructor Documentation
|
inline |
Constructor.
This also sets a default color for the piece and sets the object to which the sensor is attached to be our owner
- Parameters
-
object the object to which this graphical representation is attached offset the displacement matrix relative to the object to which we are attached startingRayPoints The vector with starting points of the rays. The points are in the frame of reference of the solid to which the sensor is attached endingRayPoints The vector with ending points of the rays. The points are in the frame of reference of the solid to which the sensor is attached drawRay if true a red segment giving the direction of the sensor is drawn. The red segment is along the local Z axis and its length is fixed drawRealRay If true the rays are drawn using their actual range (from the starting point to the ending point), otherwise only fixed length rays are drawn which only give the direction name the name of this object
Definition at line 104 of file sensorcontrollers.cpp.
References GraphicalWObject::attachToObject(), SingleIRGraphic::m_object, WObject::setColor(), WObject::setTexture(), and WObject::setUseColorTextureOfOwner().
|
inline |
Destructor.
Definition at line 128 of file sensorcontrollers.cpp.
Member Function Documentation
|
inlineprotectedvirtual |
Performs the actual drawing.
Draws the fingertip
- 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 141 of file sensorcontrollers.cpp.
References RenderWObject::container(), SingleIRGraphic::m_drawRay, SingleIRGraphic::m_drawRealRay, SingleIRGraphic::m_endingRayPoints, SingleIRGraphic::m_offset, SingleIRGraphic::m_startingRayPoints, wVectorT< Shared >::scale(), RenderWObjectContainer::setupColorTexture(), and WObject::tm.
Member Data Documentation
|
protected |
If true a red segments giving the direction of the sensor rays are drawn.
Definition at line 282 of file sensorcontrollers.cpp.
Referenced by SingleIRGraphic::render().
|
protected |
Whether to draw the actual ray lengths or not.
If true the rays are drawn using their actual range (from the starting point to the ending point), otherwise only fixed length rays are drawn which only give the direction
Definition at line 291 of file sensorcontrollers.cpp.
Referenced by SingleIRGraphic::render().
|
protected |
The vector with ending points of the rays.
The points are in the frame of reference of the solid to which the sensor is attached
Definition at line 276 of file sensorcontrollers.cpp.
Referenced by SingleIRGraphic::render().
|
protected |
The object to which this graphicalc representation is attached.
Definition at line 254 of file sensorcontrollers.cpp.
Referenced by SingleIRGraphic::SingleIRGraphic().
|
protected |
The displacement matrix relative to the object to which we are attached.
Definition at line 260 of file sensorcontrollers.cpp.
Referenced by SingleIRGraphic::render().
|
protected |
The vector with starting points of the rays.
The points are in the frame of reference of the solid to which the sensor is attached
Definition at line 268 of file sensorcontrollers.cpp.
Referenced by SingleIRGraphic::render().
The documentation for this class was generated from the following file:
- worldsim/src/sensorcontrollers.cpp