WMesh class. More...

Inheritance diagram for WMesh:

Classes

struct  Material
 Material properties. More...
 
struct  Mesh
 Mesh struct. More...
 
struct  Triangle
 Triangle struct. More...
 
struct  Vertex
 Vertex struct. More...
 

Public Member Functions

 WMesh (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity())
 Create a WMesh.
 
virtual ~WMesh ()
 Destroy this object.
 
WObjectattachedTo ()
 Return the attached WObject (NULL is there isn't)
 
void attachTo (WObject *obj)
 Attach to the WObject specified,.
 
bool loadMS3DModel (QString filename)
 Load the mesh from a MS3D file (MilkShape-3D)
 
Materialmaterials ()
 Return Materials (for now are ignored during rendering)
 
int materialsCount ()
 Number of materials.
 
Meshmeshes ()
 Return Meshes.
 
int meshesCount ()
 Number of meshes.
 
Triangletriangles ()
 Return Triangles composing the mesh.
 
int trianglesCount ()
 Number of triangles.
 
Vertexvertices ()
 Return Vertices composing the triangles of the mesh.
 
int verticesCount ()
 Number of vertices.
 
- 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 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)
 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)
 
Worldworld ()
 Return the world.
 
const Worldworld () 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.
 
Ownableowner () const
 Returns the owner of this object.
 
void setOwner (Ownable *owner, bool destroy=true)
 Sets the owner of this object.
 

Additional Inherited Members

- Public Types inherited from Ownable
typedef QList< OwnedOwnedList
 The type for the list of owned objects.
 
- Protected Member Functions inherited from WObject
virtual void changedMatrix ()
 virtual function called when the transformation matrix change
 
- Protected Attributes inherited from WObject
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

WMesh class.

\

Motivation
WMesh represent a 3D shape using a triangle mesh. It is just for graphic purpose, but it is subclass of WObject and it is contained into a World for share it amongs WCameras and for attach it to other object (like iCub's cover)
Description
Warnings
Warnings

Definition at line 41 of file wmesh.h.

Constructor & Destructor Documentation

WMesh ( World world,
QString  name = "unamed",
const wMatrix tm = wMatrix::identity() 
)

Create a WMesh.

Parameters
worldThe World which object will be inserted
tmrotation and position at the moment of creation

Definition at line 99 of file wmesh.cpp.

~WMesh ( )
virtual

Destroy this object.

Definition at line 113 of file wmesh.cpp.

Member Function Documentation

WObject* attachedTo ( )
inline

Return the attached WObject (NULL is there isn't)

Definition at line 58 of file wmesh.h.

void attachTo ( WObject obj)

Attach to the WObject specified,.

Note
when WMesh is attached to a WObject, the WMesh matrix is considered as the offset matrix respect to the matrix of WObject attached

Definition at line 140 of file wmesh.cpp.

Referenced by PhyiCub::PhyiCub().

bool loadMS3DModel ( QString  filename)

Load the mesh from a MS3D file (MilkShape-3D)

Definition at line 144 of file wmesh.cpp.

Referenced by PhyiCub::PhyiCub().

Material* materials ( )
inline

Return Materials (for now are ignored during rendering)

Definition at line 94 of file wmesh.h.

int materialsCount ( )
inline

Number of materials.

Definition at line 98 of file wmesh.h.

Mesh* meshes ( )
inline

Return Meshes.

Definition at line 86 of file wmesh.h.

int meshesCount ( )
inline

Number of meshes.

Definition at line 90 of file wmesh.h.

Triangle* triangles ( )
inline

Return Triangles composing the mesh.

Definition at line 102 of file wmesh.h.

int trianglesCount ( )
inline

Number of triangles.

Definition at line 106 of file wmesh.h.

Vertex* vertices ( )
inline

Return Vertices composing the triangles of the mesh.

Definition at line 110 of file wmesh.h.

int verticesCount ( )
inline

Number of vertices.

Definition at line 114 of file wmesh.h.


The documentation for this class was generated from the following files: