MaterialDB Class Reference

the MaterialDB class managea the material properties More...

Public Member Functions

bool createMaterial (QString name)
 Create a new material It return false if already exists a material with name passed. More...
 
void enableCollision (QString mat1, QString mat2, bool enable=true)
 Enable/Disable the collision between materials passed. More...
 
real gravityForce (QString mat)
 Return the corresponding gravity force setted If no setted, that World::gravityForce will be returned. More...
 
void setElasticity (QString mat1, QString mat2, real)
 configure the default Elasticity between materials specified the order doesn't matter More...
 
void setFrictions (QString mat1, QString mat2, real st, real kn)
 configure the default Friction between materials specified More...
 
void setGravityForce (QString mat, real force)
 configure the force gravity that will be applied to object of material specified More...
 
void setProperties (QString mat1, QString mat2, real fs, real fk, real el, real sf, bool en=true)
 set Frictions, Elasticity, Softness and Enabled/Disable collision between materials More...
 
void setSoftness (QString mat1, QString mat2, real)
 configure the default Softness between materials specified the order doesn't matter More...
 
Worldworld ()
 return the world associate with these materials More...
 

Friends

class World
 

Detailed Description

the MaterialDB class managea the material properties

It's not possibile to instantiate it, but it's automatically create when a World is created. For accessing it, use the World::materials() method.
there are some predefined materials:

Default: with default properties of physic engine used

nonCollidable: a material that doesn't collide with anything

Definition at line 63 of file world.h.

Member Function Documentation

bool createMaterial ( QString  name)

Create a new material It return false if already exists a material with name passed.

Definition at line 40 of file world.cpp.

Referenced by PhyEpuck::PhyEpuck(), PhyKhepera::PhyKhepera(), and PhyMarXbot::PhyMarXbot().

void enableCollision ( QString  mat1,
QString  mat2,
bool  enable = true 
)

Enable/Disable the collision between materials passed.

the order doesn't matter

Definition at line 119 of file world.cpp.

Referenced by PhyMarXbot::PhyMarXbot(), and MaterialDB::setProperties().

real gravityForce ( QString  mat)

Return the corresponding gravity force setted If no setted, that World::gravityForce will be returned.

Definition at line 110 of file world.cpp.

References World::gravityForce().

void setElasticity ( QString  mat1,
QString  mat2,
real  el 
)

configure the default Elasticity between materials specified the order doesn't matter

Definition at line 80 of file world.cpp.

Referenced by PhyMarXbot::PhyMarXbot(), and MaterialDB::setProperties().

void setFrictions ( QString  mat1,
QString  mat2,
real  st,
real  kn 
)

configure the default Friction between materials specified

Parameters
stStatic Friction coefficient
knKinetic Friction coefficient the order doesn't matter

Definition at line 66 of file world.cpp.

Referenced by MaterialDB::setProperties().

void setGravityForce ( QString  mat,
real  force 
)

configure the force gravity that will be applied to object of material specified

Parameters
forcethe gravity force in m/s^2

Definition at line 106 of file world.cpp.

void setProperties ( QString  mat1,
QString  mat2,
real  fs,
real  fk,
real  el,
real  sf,
bool  en = true 
)

set Frictions, Elasticity, Softness and Enabled/Disable collision between materials

Parameters
fsStatic Friction coefficient
fkKinetic Friction coefficient
elElastiticy coefficient
sfSoftness coefficient
enEnable/Disable collisions

Definition at line 131 of file world.cpp.

References MaterialDB::enableCollision(), MaterialDB::setElasticity(), MaterialDB::setFrictions(), and MaterialDB::setSoftness().

Referenced by PhyEpuck::PhyEpuck(), and PhyKhepera::PhyKhepera().

void setSoftness ( QString  mat1,
QString  mat2,
real  sf 
)

configure the default Softness between materials specified the order doesn't matter

Definition at line 93 of file world.cpp.

Referenced by PhyMarXbot::PhyMarXbot(), and MaterialDB::setProperties().

World* world ( )
inline

return the world associate with these materials

Definition at line 66 of file world.h.


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