WWCLIENT::C3DTask Class Reference

#include <C3DTask.h>

Inherits ISingleton< C3DTask >, and WWCOMMON::ITask.

List of all members.

Public Member Functions

virtual void init ()
 Initializes the whole 3D system.
virtual void update ()
 Updates animation cycles and exits if necessary.
virtual void render ()
 Called when the world needs to be rendered.
virtual void release ()
 This method, from ITask, does nothing.
virtual std::string name ()
 Pure virtual name method.
NL3D::UDriverdriver () const
NL3D::UScenescene () const
NL3D::UTextContexttextContext () const
void captureCursor (bool b)
 Captures the cursor for the GUI.
void clear ()
 Clears the driver buffers.
void clearColor (NLMISC::CRGBA color)
 Changes the clear color.
uint16 getScreenWidth ()
uint16 getScreenHeight ()

Private Attributes

NL3D::UDriverm_Driver
 Contains the NeL Window Driver.
NL3D::UTextContextm_TextContext
 Contains the NeL interface for string rendering.
NL3D::UScenem_Scene
 Contains the NeL Scene Interface.
uint16 m_ScreenWidth
 Contains the width of the screen in pixels.
uint16 m_ScreenHeight
 Contains the height of the screen in pixels.
NLMISC::CRGBA m_AmbientColor
NLMISC::CRGBA m_ClearColor
 Contains the color used to clear the driver buffers.

Detailed Description

Definition at line 58 of file C3DTask.h.


Member Function Documentation

void WWCLIENT::C3DTask::captureCursor ( bool  b  ) 

Captures the cursor for the GUI.

This method captures the cursor for use with the Gui. It uses the CGuiTask to accomplish this.

Parameters:
b boolean representing whether or not to capture the cursor.

Definition at line 224 of file C3DTask.cpp.

void WWCLIENT::C3DTask::clear ( void   ) 

Clears the driver buffers.

This clears the m_Driver buffers using m_ClearColor.

See also:
m_ClearColor

Definition at line 216 of file C3DTask.cpp.

References NL3D::UDriver::clearBuffers(), m_ClearColor, and m_Driver.

void WWCLIENT::C3DTask::clearColor ( NLMISC::CRGBA  color  ) 

Changes the clear color.

This sets m_ClearColor to the color parameter.

Parameters:
color The color to set m_ClearColor to.
See also:
m_ClearColor

Definition at line 220 of file C3DTask.cpp.

References m_ClearColor.

NL3D::UDriver & WWCLIENT::C3DTask::driver (  )  const
uint16 WWCLIENT::C3DTask::getScreenHeight (  ) 

Definition at line 232 of file C3DTask.cpp.

References m_ScreenHeight.

uint16 WWCLIENT::C3DTask::getScreenWidth (  ) 

Definition at line 228 of file C3DTask.cpp.

References m_ScreenWidth.

void WWCLIENT::C3DTask::init ( void   )  [virtual]
std::string WWCLIENT::C3DTask::name (  )  [virtual]

Pure virtual name method.

This pure virtual method is to be implemented by the specific task.

Implements WWCOMMON::ITask.

Definition at line 197 of file C3DTask.cpp.

void WWCLIENT::C3DTask::release ( void   )  [virtual]

This method, from ITask, does nothing.

Implements WWCOMMON::ITask.

Definition at line 193 of file C3DTask.cpp.

void WWCLIENT::C3DTask::render (  )  [virtual]

Called when the world needs to be rendered.

This is called, presumably only by CTaskManager, when the m_Scene needs rendering. Here's the pipeline from this method's perspective:

  1. Fog is enabled.
  2. m_Scene is rendered.
  3. Fog is disabled.
  4. CEntityManager is called to render it's pieces.

Implements WWCOMMON::ITask.

Definition at line 181 of file C3DTask.cpp.

References driver(), NL3D::UDriver::enableFog(), WWCLIENT::getClientSimulation(), WWCLIENT::CSimulationImpl::getSelfSob(), WWCOMMON::ISingleton< C3DTask >::instance(), m_Scene, NL3D::UScene::render(), and WWCOMMON::ISimulationObj::render().

NL3D::UScene & WWCLIENT::C3DTask::scene (  )  const
NL3D::UTextContext & WWCLIENT::C3DTask::textContext (  )  const

Definition at line 211 of file C3DTask.cpp.

References m_TextContext, and nlassert.

void WWCLIENT::C3DTask::update (  )  [virtual]

Updates animation cycles and exits if necessary.

First this method checks m_Driver->isActive() to make sure nothing has requested the engine to stop. m_Scene->animate() is called to process any necessary animation updates in the scene. Finally the Driver event server pipeline is pumped.

Todo:
Figure out what F1 is for and turn this back on with InfoLog.

Implements WWCOMMON::ITask.

Definition at line 165 of file C3DTask.cpp.

References NL3D::UScene::animate(), NL3D::UDriver::EventServer, WWCOMMON::ISingleton< CTimeTask >::instance(), WWCOMMON::ISingleton< CTaskManager >::instance(), NL3D::UDriver::isActive(), m_Driver, m_Scene, and NLMISC::CEventServer::pump().


Member Data Documentation

Definition at line 153 of file C3DTask.h.

Referenced by init().

Contains the color used to clear the driver buffers.

Definition at line 154 of file C3DTask.h.

Referenced by clear(), clearColor(), and init().

Contains the NeL Window Driver.

This contains a copy of NeL's UDriver which is the game window interface driver. From UDriver you can creates Scenes and render basic (slowly) primitives.

Definition at line 135 of file C3DTask.h.

Referenced by clear(), driver(), init(), and update().

Contains the NeL Scene Interface.

This is used for creating Scene instances such as cameras, lights, etc.

Definition at line 149 of file C3DTask.h.

Referenced by init(), render(), scene(), and update().

Contains the height of the screen in pixels.

Definition at line 152 of file C3DTask.h.

Referenced by getScreenHeight(), and init().

Contains the width of the screen in pixels.

Definition at line 151 of file C3DTask.h.

Referenced by getScreenWidth(), and init().

Contains the NeL interface for string rendering.

This object is used for rendering different strings to the screen.

Definition at line 142 of file C3DTask.h.

Referenced by init(), and textContext().


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

Generated on Mon Jan 11 12:04:39 2010 for Werewolf by  doxygen 1.6.1