GraphicsModule Class Reference

The graphics module of SpadeShip Project. More...

#include <GraphicsModule.h>

Collaboration diagram for GraphicsModule:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void setPropertiesAfterLoginMenu (void)
 Set properties after the character role has been selected.
void handleCrewInteraction (unsigned charID, string objName)
 Handle character crew interaction.
void setPropertiesAfterConnectionMenu (void)
 Initialize the guis as the connection menu ends/the simulation begins.
void addResource (int id, int amount)
 increase resource amount
void renderRatingMenu ()
 Render rate team menu.
void startSimulation ()
 Disable menu rendering and start simulation.
void updateRatingMenu ()
 Update rating menu for facilitator to see people sending their scores.
void updateEvaluationMenu ()
 Render the evaluation menu.
void createFireFacilitator (Real x, Real y, Real z, Real scale)
 Create fire call from facilitator.
void createPassengerFacilitator (Real x, Real y, Real z)
 Create passenger call facilitator.
void setTotalScores (Real captainTScore, Real medicTScore, Real firemanTScore)
 Set total scores of team.
OgreRefApp::CollideCameragetCamera (void) const
 get camera object
Ogre::SceneManager * getSceneManager (void) const
 get scene manager
OgreRefApp::WorldgetWorld (void) const
 get physics world
Ogre::RaySceneQuery * getRaySceneQuery (void) const
 get ray scene query object
bool isRenderingMenu (void) const
 The information about the current screen is rendering menu.
bool loginMenuLoop ()
 The login menu loop of SpadeShip.
void DisconnectClient (const unsigned charID)
 Remove the disconnected client information.
void createClientEntity (unsigned char charID, Ogre::Real x, Ogre::Real y, Ogre::Real z, Ogre::Real dirX, Ogre::Real dirY, Ogre::Real dirZ)
 Initialize the client entity.
void handleClientMovement (unsigned charID, Ogre::Real x, Ogre::Real y, Ogre::Real z, Ogre::Real dirX, Ogre::Real dirY, Ogre::Real dirZ)
 Handle the translation of client.
void sendSelectedNPCtoFlagPoint ()
 move npc to flagpoint
void startNPCtoFollow (unsigned charID, string objName)
 set npc to follow an object
void requestSelectedNPCtoFollow ()
 broadcast follow request for npc
void requestSelectedNPCtoStopFollow ()
 broadcast stop follow request for npc
void stopNPCtoFollow (unsigned charID, string objName)
 stop npc following an object

Public Attributes

int sendObjectId
 Which resource to send?

Protected Member Functions

bool configure (void)
 Configures the application - returns false if the user chooses to abandon configuration.
void chooseSceneManager (void)
 Creates the BSP SceneManager.
void createWorld (void)
 Creates the physics world.
void createCamera (void)
 Creates camera object for characters and facilitator.
void createViewports (void)
 Sets camera viewports.
void setupResources (void)
 Method which will define the source of resources (other than current folder).
void loadResources (void)
 Method which will load the resources.
bool setupGUI (void)
 Setup CEGUI windows, menus.
void createScene (void)
 Creates the default scene.
void createSceneMaca (void)
 Creates maca scenario objects.
void createPassenger (const Ogre::Vector3 &pos)
 Creates passenger npc with given position.
void createMedicCrew (const Ogre::Vector3 &pos)
 Creates medic crew npc with given position.
void createFiremanCrew (const Ogre::Vector3 &pos)
 Creates fireman crew npc with given position.
void createFire (const Ogre::Vector3 &pos, const Ogre::Real scaleFactor, bool rotate=false)
 Create fire with given position, scale factor and orientation boolean.
Ogre::String fetchNewNPCName (const Ogre::String &name)
 Increment npc agent count and return unique name.
void createFrameListener (void)
 Create frame listener.
void initComboBoxes (void)
 Initialize the combo boxes of CEGUI.
void initDemoEventWiring (void)
 Set the button-event triggering of gui.
void disableUnusedGUI (void)
 Hide unused gui menus. The necessary menu will be visible according to role.
bool handleQuit (const CEGUI::EventArgs &e)
 Quit button handler.
bool facilitatorAddPassenger (const CEGUI::EventArgs &e)
 Facilitator add passenger button handler.
bool facilitatorSendResource (const CEGUI::EventArgs &e)
 Facilitator send resource button handler.
bool facilitatorCreateFire (const CEGUI::EventArgs &e)
 Facilitator create fire button handler.
bool handleRatingContinueBtn (const CEGUI::EventArgs &e)
 Rating menu continue button handler.
bool handleInteractionButton (const CEGUI::EventArgs &e)
 Character interaction button handler.
bool handleCaptainFollowInteractionButton (const CEGUI::EventArgs &e)
 Captain follow button handler.
bool handleCaptainReleaseFollowInteractionButton (const CEGUI::EventArgs &e)
 Captain leave button handler.
bool handleCaptainDirectInteractionButton (const CEGUI::EventArgs &e)
 Captain direct button handler.
bool handleStartSimulation (const CEGUI::EventArgs &e)
 Start simulation button handler.
bool handleStart (const CEGUI::EventArgs &e)
 Start button handler.
bool handleServerOrClient (const CEGUI::EventArgs &e)
 Handle server or client selection.
bool handleFacilitatorCamera (const CEGUI::EventArgs &e)
 Handle facilitator camera selection menu.
bool handleSendResourceBtn (const CEGUI::EventArgs &e)
 Handle send resource button.
bool handleIPText (const CEGUI::EventArgs &e)
 Handle ip text in login menu.

Protected Attributes

Ogre::Root * mRoot
 rendering root
OgreRefApp::CollideCameramCamera
 colliding camera object for characters. both renders and has a body for collisions and dynamics
Ogre::SceneManager * mSceneMgr
 main scene manager
Ogre::RaySceneQuery * mRaySceneQuery
 ray scene query object for 3D picking
OgreRefApp::WorldmWorld
 simulation physics world
GraphicsModule_FrameListenermFrameListener
 link to the frame listener
bool loginMenuStart
 enabled if rendering login menu
bool menuRendering
 enabled if rendering gui menus


Detailed Description

The graphics module of SpadeShip Project.

Rendering the objects, providing the clients FPS,third person view. The module is developed using OGRE library. The graphics module handles the object entities, cameras, scene management etc.


Member Function Documentation

bool GraphicsModule::configure ( void   )  [protected]

Configures the application - returns false if the user chooses to abandon configuration.

The OGRE start window for rendering settings.

Returns:
Returns true if configuration succeeded.
The OGRE screen for setting rendering tecniques, hardware settings , full screen options , resolution etc. The settings are kept on file ogre.cfg

void GraphicsModule::chooseSceneManager ( void   )  [protected]

Creates the BSP SceneManager.

The sceneManager selection of OGRE.

The current selection is a BSPSceneManager and ST_INTERIOR.

See also:
Ogre::BSPSceneManager

void GraphicsModule::createWorld ( void   )  [protected]

Creates the physics world.

Create BSP-specific world.

void GraphicsModule::createCamera ( void   )  [protected]

Creates camera object for characters and facilitator.

Create the camera instance.

The camera is initially positioned in Z distance It is further modified to the clients position providing a FPS view.

Remarks:
The camera object has a physics body (disabled on facilitator)
See also:
OgreRefApp::CollideCamera

void GraphicsModule::createViewports ( void   )  [protected]

Sets camera viewports.

Create the viewports of the rendering window.

Remarks:
See also:
Ogre::Viewport

void GraphicsModule::setupResources ( void   )  [protected]

Method which will define the source of resources (other than current folder).

Setup the graphics resources.

The method parses the "resources.cfg" file and makes them ready for loading.

Remarks:
See also:
loadResources()|OgreConfigFile|"resources.cfg"

void GraphicsModule::loadResources ( void   )  [protected]

Method which will load the resources.

Load the graphics resources setup by setupResources() method.

Initializes the resources in resources.cfg which are set by setupResources()

Remarks:
See also:
setupResources()

bool GraphicsModule::setupGUI ( void   )  [protected]

Setup CEGUI windows, menus.

Handles the GUI setup.

Returns:
Returns true when GUISetup accomplished.
OgreCEGUIRenderer is initialized. The general settings of GUI are set.

Remarks:
Loads the CEGUI images.
See also:
CEGUI::OgreCEGUIRenderer

void GraphicsModule::createScene ( void   )  [protected]

Creates the default scene.

Create the scene to be rendered.

Initializes the light,skybox,ship,oceansurface to be rendered by OGRE.

Remarks:
See also:
setAmbientLight()|setSkyBox()|OgrePlane

void GraphicsModule::createSceneMaca ( void   )  [protected]

Creates maca scenario objects.

Create scenario objects as fire, passengers, crew etc.

void GraphicsModule::initComboBoxes ( void   )  [protected]

Initialize the combo boxes of CEGUI.

Remarks:
See also:

void GraphicsModule::setPropertiesAfterLoginMenu ( void   ) 

Set properties after the character role has been selected.

Enabled/Disable camera collision for character/facilitator Reset counter variables

void GraphicsModule::handleCrewInteraction ( unsigned  charID,
string  objName 
)

Handle character crew interaction.

Parameters:
charID Id of the interacting character
objName Name of the npc in interaction. ( fire or passenger )

bool GraphicsModule::isRenderingMenu ( void   )  const [inline]

The information about the current screen is rendering menu.

Returns:
If a GUI menu is being rendered return true else returns false.
Used for allowing/blocking some operations while rendering a menu screen

Remarks:
See also:

bool GraphicsModule::loginMenuLoop (  ) 

The login menu loop of SpadeShip.

Returns:
Return true when correct information supplied by the user.
The menu expects the user to provide information about server IP adress and character selection. As the user provides the information the connection is setup between the client and server.

Remarks:
See also:

void GraphicsModule::DisconnectClient ( const unsigned  charID  ) 

Remove the disconnected client information.

Parameters:
charID The ID of the disconneted client
Detach the visible entity of client from the scene node. Remove from the active clients vector.

Remarks:
See also:

void GraphicsModule::createClientEntity ( unsigned char  charID,
Ogre::Real  x,
Ogre::Real  y,
Ogre::Real  z,
Ogre::Real  dirX,
Ogre::Real  dirY,
Ogre::Real  dirZ 
)

Initialize the client entity.

Parameters:
charID The ID of the client
x Position on x-axis.
y Position on y-axis.
z Position on z-axis.
dir_x Direction on x-axis.
dir_y Direction on y-axis.
dir_z Direction on z-axis.
The server notifies that a client has selected a new entity. The method lets the other clients to render the new client entity. The selected entity is loaded and rendered with the given position information

Remarks:
See also:

void GraphicsModule::handleClientMovement ( unsigned  charID,
Ogre::Real  x,
Ogre::Real  y,
Ogre::Real  z,
Ogre::Real  dirX,
Ogre::Real  dirY,
Ogre::Real  dirZ 
)

Handle the translation of client.

Parameters:
charID Id of the moving client
x Tranlation in x-axis
y Tranlation in y-axis
z Tranlation in z-axis
dirX Rotation in x-axis
dirY Rotation in y-axis
dirZ Rotation in z-axis
Handle the translation of client entity notified by the server.

Remarks:
See also:


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

Generated on Sun Jun 15 18:43:27 2008 for SpadeShip Project by  doxygen 1.5.5