World's Object class. More...

Inheritance diagram for WObject:

List of all members.

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 wMatrixmatrix () 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 Worldworld () const
 Return the world (const version)
Worldworld ()
 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).
Worldworldv
 World.

Detailed Description

World's Object class.

\

Motivation
represent abstract object insertable into the World
Description
Warnings

Definition at line 64 of file world.h.


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:
worldthe world where object lives
namethe name of the object
tmrotation and position in global coordinate frame
addToWorldif 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.

Definition at line 161 of file world.h.

bool isInvisible ( ) [inline]

return if it is invisible

Definition at line 152 of file world.h.

Referenced by RenderWorld::draw(), and RenderCamera::paintGL().

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.

Definition at line 143 of file world.h.

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.

Definition at line 136 of file world.h.

void setInvisible ( bool  b) [inline]

set invisibility

Definition at line 156 of file world.h.

void setMatrix ( const wMatrix newm) [inline]
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]

set the position specified in global coordinate frame

Definition at line 91 of file world.h.

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

const World* world ( ) const [inline]

Return the world (const version)

Definition at line 100 of file world.h.


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]

Name of the WObject.

Definition at line 169 of file world.h.

Referenced by WObject::WObject().

QString texturev [protected]

Texture name.

Definition at line 171 of file world.h.

Referenced by 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().

World* worldv [protected]

World.

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: