
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 () 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) | |
![]() | |
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 | 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. | |
Additional Inherited Members | |
![]() | |
typedef QList< Owned > | OwnedList |
The type for the list of owned objects. | |
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.
|
virtual |
destroy the Object and drop it from the world
Definition at line 54 of file world.cpp.
References WObject::worldv.
Member Function Documentation
|
inlineprotectedvirtual |
|
inline |
return if it is invisible
Definition at line 152 of file world.h.
Referenced by RenderWorld::draw(), and RenderCamera::paintGL().
|
inline |
return a reference to the transformation matrix
Definition at line 82 of file world.h.
Referenced by PhyObjectsGroup::addObject(), PhyBallAndSocket::centre(), PhyFixed::centre(), PhySuspension::centre(), PhyUniversal::centre(), PhyHinge::centre(), PhyMarXbot::changedMatrix(), PhyEpuck::changedMatrix(), World::checkContacts(), World::closestPoints(), World::collisionRayCast(), RenderWorld::draw(), PhyBallAndSocket::PhyBallAndSocket(), PhyEpuck::PhyEpuck(), PhyFixed::PhyFixed(), PhyHinge::PhyHinge(), PhyiCub::PhyiCub(), PhyMarXbot::PhyMarXbot(), PhyObjectsGroup::PhyObjectsGroup(), PhySuspension::PhySuspension(), PhyUniversal::PhyUniversal(), PhyMarXbot::postUpdate(), PhyEpuck::postUpdate(), PhyMarXbot::preUpdate(), PhyEpuck::preUpdate(), PhyObjectsGroup::setDOFPosition(), SingleIR::update(), PhyBallAndSocket::updateJointInfo(), PhyFixed::updateJointInfo(), PhySuspension::updateJointInfo(), PhyUniversal::updateJointInfo(), PhyHinge::updateJointInfo(), GraphicalWObject::updateMatrixFromAttachedObject(), PhyObjectsGroup::updateRelativePositions(), and WCamera::WCamera().
|
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().
|
inlinevirtual |
postUpdate the WObject this method is called at each step of the world just after the physic update
Reimplemented in PhyObjectsGroup, PhyiCub, PhyEpuck, WCamera, and PhyMarXbot.
|
inlinevirtual |
preUpdate the WObject this method is called at each step of the world just before the physic update
Reimplemented in PhyObjectsGroup, PhyiCub, PhyEpuck, WCamera, and PhyMarXbot.
|
inline |
set a new matrix
Definition at line 147 of file world.h.
Referenced by PhyMarXbot::changedMatrix(), PhyEpuck::changedMatrix(), PhyEpuck::PhyEpuck(), PhyiCub::PhyiCub(), PhyMarXbot::PhyMarXbot(), PhyMarXbot::preUpdate(), WCamera::preUpdate(), PhyEpuck::preUpdate(), GraphicalWObject::updateMatrixFromAttachedObject(), and WCamera::WCamera().
|
inline |
set the position specified in global coordinate frame
Definition at line 86 of file world.h.
Referenced by PhyiCub::PhyiCub().
|
inline |
|
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().
|
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().
|
inline |
Return the texture name.
Definition at line 112 of file world.h.
Referenced by RenderWObjectContainer::setupColorTexture().
|
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().
|
inline |
Return the world.
Definition at line 96 of file world.h.
Referenced by PhyCompoundObject::createPrivateObject(), PhyiCub::enableCameras(), PhyiCub::enableRightArmCartesianController(), PhyJoint::PhyJoint(), PhyMarXbot::PhyMarXbot(), PhyMarXbot::preUpdate(), PhyEpuck::preUpdate(), YarpObject::registerServerControlBoard(), YarpObject::registerServerFrameGrabber(), YarpObject::removeServerControlBoard(), SingleIR::update(), WCamera::WCamera(), and WorldController::WorldController().
|
inline |
Member Data Documentation
|
protected |
Color, it contains also alpha channel.
Definition at line 173 of file world.h.
Referenced by WObject::WObject().
|
protected |
if TRUE it will not renderized
Definition at line 175 of file world.h.
Referenced by WObject::WObject().
|
protected |
|
protected |
|
protected |
Trasformation matrix.
Definition at line 167 of file world.h.
Referenced by PhyObject::changedMatrix(), PhyMarXbot::changedMatrix(), PhyEpuck::changedMatrix(), PhyEpuck::PhyEpuck(), PhyiCub::PhyiCub(), PhyMarXbot::PhyMarXbot(), PhyObjectsGroup::PhyObjectsGroup(), PhyMarXbot::postUpdate(), PhyEpuck::postUpdate(), SingleIRGraphic::render(), PhyObject::setKinematic(), PhyiCub::setTorso0Matrix(), and WObject::WObject().
|
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().
|
protected |
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: