Classes

PSphere

This is the class containing all the information about the planet. It contains also the main functions to interact with it.

void attachMesh(Ogre::SceneNode *node, Ogre::SceneManager *scene, const std::string &meshName, const std::string &objectName, Ogre::Real latitude, Ogre::Real longitude)

With this function it's possible to attach objects to the planet. Such objects have to be in the format .mesh, and contained in the folder indicated in the resource.cfg file (e.g. FileSystem=media/models), or loaded manually.

bool checkAccessibility(Ogre::Vector3 location)

It tells if there's water or if there's already another object in a certain position. If the returned value is true there are no objects or water in that position.

bool checkIfObjectIsIn(std::string &objectName)

It tells if an object with a certain name as already been put on the planet. If the returned value is true, an object with that name is already on the planet.

void create(Ogre::uint32 iters, ResourceParameter resourceParameter)

It creates a sphere out of a cube that is made of 6 squares. The parameter accepted are the number of vertexes that compose the planet (that permit do decide the quality of details) and a ResourceParameter object, which contains all the information regarding the planet.

Ogre::Real getRadius()

It returns the radius of the planet.

void loadToBuffers(const std::string &meshName, const std::string &textureName)

It draws the planet. After setting all the parameters describing the planet, this function draws it in the window. This planet has to be attached to a node in the primary scene.

void moveObject(const std::string &objectName, int direction, float pace)

It moves a specified object in a certain direction.

void setObserverPosition(Ogre::Vector3 position)

Set position for the observer. This must be a position vector in modelspace, not in worldspace.