#include <C3DTask.h>
Inherits ISingleton< C3DTask >, and WWCOMMON::ITask.
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::UDriver & | driver () const |
| NL3D::UScene & | scene () const |
| NL3D::UTextContext & | textContext () 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::UDriver * | m_Driver |
| Contains the NeL Window Driver. | |
| NL3D::UTextContext * | m_TextContext |
| Contains the NeL interface for string rendering. | |
| NL3D::UScene * | m_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. | |
Definition at line 58 of file C3DTask.h.
| 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.
| 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.
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.
| color | The color to set m_ClearColor to. |
Definition at line 220 of file C3DTask.cpp.
References m_ClearColor.
| NL3D::UDriver & WWCLIENT::C3DTask::driver | ( | ) | const |
Definition at line 201 of file C3DTask.cpp.
References m_Driver, and nlassert.
Referenced by WWCLIENT::CPlayerController::CPlayerController(), render(), WWCLIENT::CPlayerController::update(), and WWCLIENT::CPlayerController::~CPlayerController().
| 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] |
Initializes the whole 3D system.
This should be called only once. It loads all of the 3D variables from the configuration file and sets up the UDriver, UScene, and UTextContext settings. Too many things to at-see.
Implements WWCOMMON::ITask.
Definition at line 76 of file C3DTask.cpp.
References NLMISC::CConfigFile::CVar::asInt(), WWCLIENT::CConfigTask::configFile(), NL3D::UDriver::createScene(), NL3D::UDriver::createTextContext(), degToRad(), NL3D::UDriver::enableFog(), NL3D::UScene::enableLightingSystem(), NL3D::UScene::getCam(), NL3D::UDriver::getDisplay(), NL3D::CSceneUser::getScene(), NL3D::CScene::getShapeBank(), NLMISC::CConfigFile::getVar(), GScale, IDI_ICON1, WWCOMMON::ISingleton< CConfigTask >::instance(), WWCOMMON::ISingleton< C3DTask >::instance(), m_AmbientColor, m_ClearColor, m_Driver, m_Scene, m_ScreenHeight, m_ScreenWidth, m_TextContext, nlassert, nlwarning, NLMISC::CRGBA::set(), NL3D::UDriver::setAmbientColor(), NL3D::UDriver::setDisplay(), NL3D::UDriver::setFontManagerMaxMemory(), NL3D::UScene::setGroupLoadMaxPolygon(), NL3D::UTextContext::setKeep800x600Ratio(), NL3D::UCamera::setPerspective(), NL3D::UScene::setPolygonBalancingMode(), NL3D::UScene::setShadowMapBlurSize(), NL3D::CShapeBank::setShapeCacheSize(), NL3D::UDriver::setSwapVBLInterval(), NL3D::UTransformable::setTransformMode(), NL3D::UDriver::setupFog(), and NLMISC::CConfigFile::CVar::size().
| 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:
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 |
Definition at line 206 of file C3DTask.cpp.
References m_Scene, and nlassert.
Referenced by WWCLIENT::CMeshGroup::CMesh::getInstance(), WWCLIENT::CEntityMedia::getTransform(), WWCLIENT::CCameraThird::init(), WWCLIENT::CEntityMedia::~CEntityMedia(), WWCLIENT::CMeshGroup::CMesh::~CMesh(), and WWCLIENT::CSkeleton::~CSkeleton().
| 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.
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().
NLMISC::CRGBA WWCLIENT::C3DTask::m_ClearColor [private] |
Contains the color used to clear the driver buffers.
Definition at line 154 of file C3DTask.h.
Referenced by clear(), clearColor(), and init().
NL3D::UDriver* WWCLIENT::C3DTask::m_Driver [private] |
NL3D::UScene* WWCLIENT::C3DTask::m_Scene [private] |
uint16 WWCLIENT::C3DTask::m_ScreenHeight [private] |
Contains the height of the screen in pixels.
Definition at line 152 of file C3DTask.h.
Referenced by getScreenHeight(), and init().
uint16 WWCLIENT::C3DTask::m_ScreenWidth [private] |
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().
1.6.1