Public Member Functions | Public Attributes | Protected Attributes

Environment Class Reference

class is responsible for performing all the tasks which come from the user after they have been ‘interpreted’ by m_gl window. These tasks may include: loading of new objects/animation into the scene, conversion of the static object into the cloth, deleting the objects in which the user is not interested any longer, maintain the collisions between the objects of the scene, set-up parameters and integration methods to each particular cloth, descretize all the objects of the scene into hash cells for fast collision detection. More...

#include <Environment.h>

List of all members.

Public Member Functions

 Environment (ngl::TransformStack *_transform)
 Constractor [in] _transform reference to the transformation stack.
 ~Environment ()
 Destructor.
void PutObjectsInHash ()
 the method put all objects in the hash table
void UpdateEnvironment ()
 the method to update all the parameters and states of objects
void CheckCollisions ()
 the method to perform collisions between the objects
void setCurrentObject (std::string _currentObject)
 the method to set the object which is selected by user at the moment [in] _currentObject the object to be set as current
void setCurrentCloth (std::string _currentCloth)
 the method to set the cloth which is selected by user at the moment [in] _currentCloth the cloth to be set as current
std::string CreateObject (std::string _fileName, std::string _objectName)
 the method to create a new object in the environment [in] _fileName the name of the file which contains the mesh of the object, which is due to be created
bool deleteObject (std::string _objectName)
 the method deletes the object fro the environment based on its name [in] _objectName the name of the object to be deleted [out] result of the delete action
std::string CreateClothObject (float _clothSize, int _massesNum, float _damping, float _springDamping, float _timeStep, float _gravity, float _stiffeness, float _criticalDistance, float _friction, float _bumpiness, std::string _objectName, std::string _fileName)
 the method to create a cloth object from the mesh [in] clothSize the size of the cloth [in] _massesNum amount of masses to be used to generate the cloth [in] _damping the damping of the cloth, this parameter effects masses of the cloth [in] _springDamping damping of the cloth, this parameter effects springs of the cloth [in] _timeStep time step for integration [in] _gravity gravity force acting on each mass of the cloth [in] _stiffeness stiffness of the cloth [in] _criticalDistance the distance which should be maintained between the cloth and other objects of the scene [in] _friction fricition of the cloth [in] _bumpiness bumpiness of the cloth [in] _objectName the name of the cloth object [in] _fileName the name of the file, containing the mesh to create a cloth
std::string CreateAnimation (QStringList _listOfOBJs, std::string _animName)
 the method to create animation from the list of files [in] _listOfOBJs list of files to load the mesh from [in] _animName the name which animation will have
std::string ResetTheScene (std::string _fileName, std::string _objectName, float _clothSize, int _massesNum, float _damping, float _springDamping, float _timeStep, float _gravity, float _stiffeness, float _criticalDistance, float _friction, float _bumpiness)
 the method resets the whole scene [in] _objectName the name of the cloth object [in] _fileName the name of the file, containing the mesh to create a cloth [in] clothSize the size of the cloth [in] _massesNum amount of masses to be used to generate the cloth [in] _damping the damping of the cloth, this parameter effects masses of the cloth [in] _springDamping damping of the cloth, this parameter effects springs of the cloth [in] _timeStep time step for integration [in] _gravity gravity force acting on each mass of the cloth [in] _stiffeness stiffness of the cloth [in] _criticalDistance the distance which should be maintained between the cloth and other objects of the scene [in] _friction fricition of the cloth [in] _bumpiness bumpiness of the cloth
std::string resetCloth (float _clothSize, int _massesNum, float _damping, float _springDamping, float _timeStep, float _gravity, float _stiffeness, float _criticalDistance, float _friction, float _bumpiness)
 the method which resets the cloth [in] clothSize the size of the cloth [in] _massesNum amount of masses to be used to generate the cloth [in] _damping the damping of the cloth, this parameter effects masses of the cloth [in] _springDamping damping of the cloth, this parameter effects springs of the cloth [in] _timeStep time step for integration [in] _gravity gravity force acting on each mass of the cloth [in] _stiffeness stiffness of the cloth [in] _criticalDistance the distance which should be maintained between the cloth and other objects of the scene [in] _friction fricition of the cloth [in] _bumpiness bumpiness of the cloth
ObjObjectgetObjectByName (std::string _objectName)
 the method returns the object from the list of the objects by name [in] _objectName the name of the object, which needs to be find [out] the object which has been found by name
void setMovingMass (int x, int y)
 the method sets the mass, defined by 2D coordinates of mesh as an active mass, controlled by the user [in] x coordinate of the mass [in] y coordinate of the mass
void moveMass (int x, int y, int z)
 the method translates the active mass by a vector defined [in] x coordinate of the translation vector [in] y coordinate of the translation vector [in] z coordinate of the translation vector

Public Attributes

std::vector< ObjObject * > m_listOfObjects
 m_listOfObjects list of all objects which exist in the environment
CollisionsManagerm_collisionsManager
 m_listOfObjects list of all objects which exist in the environment
ObjObjectm_currentObject
 the object from the list of objects, which is chosen by the user at the moment
ObjObjectm_currentCloth
 the cloth from the list of objects, which is chosen by the user at the moment

Protected Attributes

ngl::TransformStack * m_transform
 transformation stack

Detailed Description

class is responsible for performing all the tasks which come from the user after they have been ‘interpreted’ by m_gl window. These tasks may include: loading of new objects/animation into the scene, conversion of the static object into the cloth, deleting the objects in which the user is not interested any longer, maintain the collisions between the objects of the scene, set-up parameters and integration methods to each particular cloth, descretize all the objects of the scene into hash cells for fast collision detection.


Member Function Documentation

std::string Environment::CreateObject ( std::string  _fileName,
std::string  _objectName 
)

the method to create a new object in the environment [in] _fileName the name of the file which contains the mesh of the object, which is due to be created

[in] _objectName th ename of the object to create


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables