WObject Class Reference
World's Object class. More...

Public Member Functions | |
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 |
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) |
void | setColor (QColor c) |
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 () |
if true, we will use color and texture of our owner (if we have one) | |
const World * | world () const |
Return the world (const version) | |
World * | world () |
Return the world. | |
Protected Member Functions | |
virtual void | changedMatrix () |
virtual function called when the transformation matrix change | |
Protected Attributes | |
QColor | colorv |
Color, it contains also alpha channel. | |
bool | invisible |
if TRUE it will not renderized | |
QString | namev |
Name of the WObject. | |
QString | texturev |
Texture name. | |
wMatrix | tm |
Trasformation matrix. | |
bool | usecolortextureofowner |
if true, we will use color and texture of our owner (if we have one). | |
World * | worldv |
World. |
Detailed Description
World's Object class.
\
- Motivation
- represent abstract object insertable into the World
- Description
- Warnings
Constructor & Destructor Documentation
WObject | ( | World * | world, |
QString | name = "unamed" , |
||
const wMatrix & | tm = wMatrix::identity() , |
||
bool | addToWorld = true |
||
) |
create the object and automatically put this into the world
- Parameters:
-
world the world where object lives name the name of the object tm rotation and position in global coordinate frame addToWorld if true the object is added to the world, if false it is not. This parameter should be set to false when this constructor is called by the constructor of a subclass because otherwise RTTI in this moment (e.g. in RenderWorld) identifies the newly added object as a WObject instead of the actual type (as the subclasses have not been constructed yet when the object is added to the world)
Definition at line 41 of file world.cpp.
References WObject::colorv, WObject::invisible, WObject::name(), WObject::namev, WObject::texturev, WObject::tm, WObject::usecolortextureofowner, and WObject::worldv.
~WObject | ( | ) | [virtual] |
destroy the Object and drop it from the world
Definition at line 54 of file world.cpp.
References WObject::worldv.
Member Function Documentation
virtual void changedMatrix | ( | ) | [inline, protected, virtual] |
virtual function called when the transformation matrix change
Reimplemented in PhyiCub, PhyMarXbot, and PhyObject.
bool isInvisible | ( | ) | [inline] |
return if it is invisible
Definition at line 152 of file world.h.
Referenced by RenderWorld::draw(), and RenderCamera::paintGL().
const wMatrix& matrix | ( | ) | const [inline] |
return a reference to the transformation matrix
Definition at line 82 of file world.h.
Referenced by PhyObjectsGroup::addObject(), PhyUniversal::centre(), PhySuspension::centre(), PhyHinge::centre(), PhyFixed::centre(), PhyBallAndSocket::centre(), PhyMarXbot::changedMatrix(), World::checkContacts(), World::closestPoints(), World::collisionRayCast(), RenderWorld::draw(), PhyBallAndSocket::PhyBallAndSocket(), PhyFixed::PhyFixed(), PhyHinge::PhyHinge(), PhyiCub::PhyiCub(), PhyMarXbot::PhyMarXbot(), PhyObjectsGroup::PhyObjectsGroup(), PhySuspension::PhySuspension(), PhyUniversal::PhyUniversal(), PhyObjectsGroup::setDOFPosition(), SingleIR::update(), PhyUniversal::updateJointInfo(), PhySuspension::updateJointInfo(), PhyHinge::updateJointInfo(), PhyFixed::updateJointInfo(), PhyBallAndSocket::updateJointInfo(), GraphicalWObject::updateMatrixFromAttachedObject(), PhyObjectsGroup::updateRelativePositions(), and WCamera::WCamera().
QString name | ( | ) | const [inline] |
Return the name of this object.
Definition at line 104 of file world.h.
Referenced by PhyiCub::enableCameras(), PhyiCub::enableRightArmCartesianController(), World::getObject(), YarpObject::registerServerControlBoard(), YarpObject::registerServerFrameGrabber(), YarpObject::removeServerControlBoard(), WCamera::WCamera(), WObject::WObject(), and WorldController::WorldController().
virtual void postUpdate | ( | ) | [inline, virtual] |
postUpdate the WObject this method is called at each step of the world just after the physic update
Reimplemented in PhyiCub, PhyObjectsGroup, PhyMarXbot, and WCamera.
virtual void preUpdate | ( | ) | [inline, virtual] |
preUpdate the WObject this method is called at each step of the world just before the physic update
Reimplemented in PhyiCub, PhyObjectsGroup, PhyMarXbot, and WCamera.
void setMatrix | ( | const wMatrix & | newm | ) | [inline] |
set a new matrix
Definition at line 147 of file world.h.
Referenced by PhyMarXbot::changedMatrix(), PhyiCub::PhyiCub(), PhyMarXbot::PhyMarXbot(), WCamera::preUpdate(), GraphicalWObject::updateMatrixFromAttachedObject(), and WCamera::WCamera().
void setPosition | ( | const wVector & | newpos | ) | [inline] |
set the position specified in global coordinate frame
Definition at line 86 of file world.h.
Referenced by PhyiCub::PhyiCub().
void setPosition | ( | real | x, |
real | y, | ||
real | z | ||
) | [inline] |
void setTexture | ( | QString | textureName | ) | [inline] |
Set the texture to use for this WObject when rendered.
Definition at line 108 of file world.h.
Referenced by PhyiCub::PhyiCub(), and SingleIRGraphic::SingleIRGraphic().
void setUseColorTextureOfOwner | ( | bool | b | ) | [inline] |
set if the object will be rendered with the color and texture of our owner (if we have one)
Definition at line 129 of file world.h.
Referenced by PhyMarXbot::PhyMarXbot(), and SingleIRGraphic::SingleIRGraphic().
QString texture | ( | ) | const [inline] |
Return the texture name.
Definition at line 112 of file world.h.
Referenced by RenderWObjectContainer::setupColorTexture().
bool useColorTextureOfOwner | ( | ) | [inline] |
if true, we will use color and texture of our owner (if we have one)
Definition at line 125 of file world.h.
Referenced by RenderWObjectContainer::setupColorTexture().
World* world | ( | ) | [inline] |
Return the world.
Definition at line 96 of file world.h.
Referenced by PhyCompoundObject::createPrivateObject(), PhyiCub::enableCameras(), PhyiCub::enableRightArmCartesianController(), PhyJoint::PhyJoint(), PhyMarXbot::PhyMarXbot(), YarpObject::registerServerControlBoard(), YarpObject::registerServerFrameGrabber(), YarpObject::removeServerControlBoard(), SingleIR::update(), WCamera::WCamera(), and WorldController::WorldController().
const World* world | ( | ) | const [inline] |
Member Data Documentation
QColor colorv [protected] |
Color, it contains also alpha channel.
Definition at line 173 of file world.h.
Referenced by WObject::WObject().
bool invisible [protected] |
if TRUE it will not renderized
Definition at line 175 of file world.h.
Referenced by WObject::WObject().
QString namev [protected] |
QString texturev [protected] |
Trasformation matrix.
Definition at line 167 of file world.h.
Referenced by PhyObject::changedMatrix(), PhyMarXbot::changedMatrix(), PhyiCub::PhyiCub(), PhyMarXbot::PhyMarXbot(), PhyObjectsGroup::PhyObjectsGroup(), SingleIRGraphic::render(), PhyObject::setKinematic(), PhyiCub::setTorso0Matrix(), and WObject::WObject().
bool usecolortextureofowner [protected] |
if true, we will use color and texture of our owner (if we have one).
True by default
Definition at line 177 of file world.h.
Referenced by WObject::WObject().
Definition at line 163 of file world.h.
Referenced by WObject::WObject(), and WObject::~WObject().
The documentation for this class was generated from the following files: