Blender V2.61 - r43446
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions

KX_KetsjiEngine Class Reference

#include <KX_KetsjiEngine.h>

List of all members.

Public Member Functions

 KX_KetsjiEngine (class KX_ISystem *system)
virtual ~KX_KetsjiEngine ()
void SetWorldSettings (KX_WorldInfo *worldinfo)
void SetKeyboardDevice (SCA_IInputDevice *keyboarddevice)
void SetMouseDevice (SCA_IInputDevice *mousedevice)
void SetNetworkDevice (NG_NetworkDeviceInterface *networkdevice)
void SetCanvas (RAS_ICanvas *canvas)
void SetRenderTools (RAS_IRenderTools *rendertools)
void SetRasterizer (RAS_IRasterizer *rasterizer)
void SetSceneConverter (KX_ISceneConverter *sceneconverter)
void SetAnimRecordMode (bool animation_record, int startFrame)
RAS_IRasterizerGetRasterizer ()
RAS_ICanvasGetCanvas ()
RAS_IRenderToolsGetRenderTools ()
SCA_IInputDeviceGetKeyboardDevice ()
SCA_IInputDeviceGetMouseDevice ()
void InitDome (short res, short mode, short angle, float resbuf, short tilt, struct Text *text)
 Dome functions.
void EndDome ()
void RenderDome ()
bool NextFrame ()
 returns true if an update happened to indicate -> Render
void Render ()
void StartEngine (bool clearIpo)
void StopEngine ()
void Export (const STR_String &filename)
void RequestExit (int exitrequestmode)
void SetNameNextGame (const STR_String &nextgame)
int GetExitCode ()
const STR_StringGetExitString ()
KX_SceneListCurrentScenes ()
KX_SceneFindScene (const STR_String &scenename)
void AddScene (class KX_Scene *scene)
void ConvertAndAddScene (const STR_String &scenename, bool overlay)
void RemoveScene (const STR_String &scenename)
void ReplaceScene (const STR_String &oldscene, const STR_String &newscene)
void SuspendScene (const STR_String &scenename)
void ResumeScene (const STR_String &scenename)
void GetSceneViewport (KX_Scene *scene, KX_Camera *cam, RAS_Rect &area, RAS_Rect &viewport)
void SetDrawType (int drawingtype)
int GetDrawType ()
void SetCameraZoom (float camzoom)
void EnableCameraOverride (const STR_String &forscene)
void SetCameraOverrideUseOrtho (bool useOrtho)
void SetCameraOverrideProjectionMatrix (const MT_CmMatrix4x4 &mat)
void SetCameraOverrideViewMatrix (const MT_CmMatrix4x4 &mat)
void SetCameraOverrideClipping (float near, float far)
void SetCameraOverrideLens (float lens)
void SetUseFixedTime (bool bUseFixedTime)
bool GetUseFixedTime (void) const
double GetClockTime (void) const
double GetFrameTime (void) const
double GetRealTime (void) const
void SetTimingDisplay (bool frameRate, bool profile, bool properties)
void GetTimingDisplay (bool &frameRate, bool &profile, bool &properties) const
void SetHideCursor (bool hideCursor)
bool GetHideCursor (void) const
void SetUseOverrideFrameColor (bool overrideFrameColor)
bool GetUseOverrideFrameColor (void) const
void SetOverrideFrameColor (float r, float g, float b)
void GetOverrideFrameColor (float &r, float &g, float &b) const
KX_SceneCreateScene (const STR_String &scenename)
KX_SceneCreateScene (Scene *scene)
GlobalSettingsGetGlobalSettings (void)
void SetGlobalSettings (GlobalSettings *gs)

Static Public Member Functions

static double GetSuspendedDelta ()
static double GetTicRate ()
static void SetTicRate (double ticrate)
static int GetMaxLogicFrame ()
static void SetMaxLogicFrame (int frame)
static int GetMaxPhysicsFrame ()
static void SetMaxPhysicsFrame (int frame)
static bool GetRestrictAnimationFPS ()
static void SetRestrictAnimationFPS (bool bRestrictAnimFPS)
static double GetAnimFrameRate ()
static void SetAnimFrameRate (double framerate)
static double GetAverageFrameRate ()
static void SetExitKey (short key)
static short GetExitKey ()

Public Attributes

bool m_usedome

Protected Member Functions

void ProcessScheduledScenes (void)
void SceneListsChanged (void)
void RemoveScheduledScenes (void)
void AddScheduledScenes (void)
void ReplaceScheduledScenes (void)
void PostProcessScene (class KX_Scene *scene)
bool BeginFrame ()
void ClearFrame ()
void EndFrame ()

Detailed Description

KX_KetsjiEngine is the core game engine class.

Definition at line 71 of file KX_KetsjiEngine.h.


Constructor & Destructor Documentation

KX_KetsjiEngine::KX_KetsjiEngine ( class KX_ISystem system)

Constructor of the Ketsji Engine

Definition at line 119 of file KX_KetsjiEngine.cpp.

References KX_TimeCategoryLogger::AddCategory(), and i.

KX_KetsjiEngine::~KX_KetsjiEngine ( ) [virtual]

Destructor of the Ketsji Engine, release all memory

Definition at line 194 of file KX_KetsjiEngine.cpp.

References m_usedome.


Member Function Documentation

void KX_KetsjiEngine::AddScene ( class KX_Scene scene)

Definition at line 1384 of file KX_KetsjiEngine.cpp.

References PostProcessScene(), and SceneListsChanged().

Referenced by GPG_Application::startEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::AddScheduledScenes ( void  ) [protected]

Definition at line 1669 of file KX_KetsjiEngine.cpp.

References CreateScene(), and PostProcessScene().

Referenced by ProcessScheduledScenes().

bool KX_KetsjiEngine::BeginFrame ( ) [protected]
void KX_KetsjiEngine::ClearFrame ( ) [protected]
void KX_KetsjiEngine::ConvertAndAddScene ( const STR_String scenename,
bool  overlay 
)

Definition at line 1583 of file KX_KetsjiEngine.cpp.

References FindScene(), and STR_String::Ptr().

Referenced by KX_SceneActuator::Update().

KX_Scene * KX_KetsjiEngine::CreateScene ( const STR_String scenename)
KX_Scene * KX_KetsjiEngine::CreateScene ( Scene scene)

Definition at line 1647 of file KX_KetsjiEngine.cpp.

References KX_ISceneConverter::ConvertScene(), Scene::id, and ID::name.

KX_SceneList * KX_KetsjiEngine::CurrentScenes ( )
void KX_KetsjiEngine::EnableCameraOverride ( const STR_String forscene)

Definition at line 1060 of file KX_KetsjiEngine.cpp.

Referenced by StartKetsjiShell().

void KX_KetsjiEngine::EndDome ( )
void KX_KetsjiEngine::EndFrame ( ) [protected]
void KX_KetsjiEngine::Export ( const STR_String filename)
KX_Scene * KX_KetsjiEngine::FindScene ( const STR_String scenename)

Definition at line 1567 of file KX_KetsjiEngine.cpp.

References NULL.

Referenced by ConvertAndAddScene(), RemoveScene(), ResumeScene(), and SuspendScene().

double KX_KetsjiEngine::GetAnimFrameRate ( ) [static]
double KX_KetsjiEngine::GetAverageFrameRate ( ) [static]

Gets the last estimated average framerate

Definition at line 1856 of file KX_KetsjiEngine.cpp.

RAS_ICanvas* KX_KetsjiEngine::GetCanvas ( ) [inline]

Definition at line 231 of file KX_KetsjiEngine.h.

References KX_Dome::m_canvas.

Referenced by ImageRender::ImageRender().

double KX_KetsjiEngine::GetClockTime ( void  ) const

Returns current render frame clock time

Definition at line 1836 of file KX_KetsjiEngine.cpp.

Referenced by ImageRender::Render(), and Texture_refresh().

int KX_KetsjiEngine::GetDrawType ( ) [inline]

Definition at line 268 of file KX_KetsjiEngine.h.

References KX_Dome::m_drawingmode.

int KX_KetsjiEngine::GetExitCode ( )
short KX_KetsjiEngine::GetExitKey ( ) [static]
const STR_String & KX_KetsjiEngine::GetExitString ( )

Definition at line 1000 of file KX_KetsjiEngine.cpp.

Referenced by GPG_Application::processEvent(), and StartKetsjiShell().

double KX_KetsjiEngine::GetFrameTime ( void  ) const

Returns current logic frame clock time

Definition at line 1841 of file KX_KetsjiEngine.cpp.

Referenced by BL_Action::Play().

GlobalSettings * KX_KetsjiEngine::GetGlobalSettings ( void  )

Definition at line 1968 of file KX_KetsjiEngine.cpp.

Referenced by GPG_Application::getGlobalSettings(), and StartKetsjiShell().

bool KX_KetsjiEngine::GetHideCursor ( void  ) const

Returns the current setting for cursor hiding.

Returns:
The current setting for cursor hiding.

Definition at line 1929 of file KX_KetsjiEngine.cpp.

SCA_IInputDevice* KX_KetsjiEngine::GetKeyboardDevice ( ) [inline]

Definition at line 233 of file KX_KetsjiEngine.h.

int KX_KetsjiEngine::GetMaxLogicFrame ( ) [static]

Gets the maximum number of logic frame before render frame

Definition at line 1801 of file KX_KetsjiEngine.cpp.

int KX_KetsjiEngine::GetMaxPhysicsFrame ( ) [static]

Gets the maximum number of physics frame before render frame

Definition at line 1811 of file KX_KetsjiEngine.cpp.

SCA_IInputDevice* KX_KetsjiEngine::GetMouseDevice ( ) [inline]

Definition at line 234 of file KX_KetsjiEngine.h.

void KX_KetsjiEngine::GetOverrideFrameColor ( float &  r,
float &  g,
float &  b 
) const

Returns the color used for framing bar color instead of the one in the Blender file's scenes.

Parameters:
rRed component of the override color.
gGreen component of the override color.
bBlue component of the override color.

Definition at line 1955 of file KX_KetsjiEngine.cpp.

RAS_IRasterizer* KX_KetsjiEngine::GetRasterizer ( ) [inline]

Definition at line 230 of file KX_KetsjiEngine.h.

References KX_Dome::m_rasterizer.

Referenced by BL_ConvertActuators(), and ImageRender::ImageRender().

double KX_KetsjiEngine::GetRealTime ( void  ) const

Definition at line 1846 of file KX_KetsjiEngine.cpp.

References KX_ISystem::GetTimeInSeconds().

Referenced by BL_ConvertActuators(), and BL_ConvertSensors().

RAS_IRenderTools* KX_KetsjiEngine::GetRenderTools ( ) [inline]

Definition at line 232 of file KX_KetsjiEngine.h.

References KX_Dome::m_rendertools.

Referenced by ImageRender::ImageRender().

bool KX_KetsjiEngine::GetRestrictAnimationFPS ( ) [static]

Gets whether or not to lock animation updates to the animframerate

Definition at line 1821 of file KX_KetsjiEngine.cpp.

Referenced by NextFrame().

void KX_KetsjiEngine::GetSceneViewport ( KX_Scene scene,
KX_Camera cam,
RAS_Rect area,
RAS_Rect viewport 
)
double KX_KetsjiEngine::GetSuspendedDelta ( ) [static]

Returns the difference between the local time of the scene (when it was running and not suspended) and the "curtime"

Definition at line 1786 of file KX_KetsjiEngine.cpp.

Referenced by BL_Action::Update(), BL_ShapeActionActuator::Update(), and KX_IpoActuator::Update().

double KX_KetsjiEngine::GetTicRate ( ) [static]

Gets the number of logic updates per second.

Definition at line 1791 of file KX_KetsjiEngine.cpp.

Referenced by KX_Scene::LogicBeginFrame().

void KX_KetsjiEngine::GetTimingDisplay ( bool &  frameRate,
bool &  profile,
bool &  properties 
) const

Returns status of timing information display.

Parameters:
frameRateDisplay for frame rate on or off.
profileDisplay for individual components on or off.
propertiesDisplay of scene object debug properties on or off.

Definition at line 1880 of file KX_KetsjiEngine.cpp.

bool KX_KetsjiEngine::GetUseFixedTime ( void  ) const

Returns display of all frames.

Returns:
Current setting for display all frames.

Definition at line 1781 of file KX_KetsjiEngine.cpp.

bool KX_KetsjiEngine::GetUseOverrideFrameColor ( void  ) const

Check if the frame color is being overridden.

Definition at line 1941 of file KX_KetsjiEngine.cpp.

void KX_KetsjiEngine::InitDome ( short  res,
short  mode,
short  angle,
float  resbuf,
short  tilt,
struct Text text 
)

Dome functions.

Definition at line 267 of file KX_KetsjiEngine.cpp.

References m_usedome.

Referenced by GPG_Application::startEngine(), and StartKetsjiShell().

bool KX_KetsjiEngine::NextFrame ( )
void KX_KetsjiEngine::PostProcessScene ( class KX_Scene scene) [protected]
void KX_KetsjiEngine::ProcessScheduledScenes ( void  ) [protected]

Processes all scheduled scene activity. At the end, if the scene lists have changed, SceneListsChanged(void) is called.

See also:
SceneListsChanged(void).

Definition at line 1889 of file KX_KetsjiEngine.cpp.

References AddScheduledScenes(), RemoveScheduledScenes(), ReplaceScheduledScenes(), and SceneListsChanged().

Referenced by NextFrame().

void KX_KetsjiEngine::RemoveScene ( const STR_String scenename)

Definition at line 1607 of file KX_KetsjiEngine.cpp.

References FindScene().

Referenced by KX_SceneActuator::Update().

void KX_KetsjiEngine::RemoveScheduledScenes ( void  ) [protected]

Definition at line 1622 of file KX_KetsjiEngine.cpp.

References KX_Scene::GetName(), and KX_ISceneConverter::RemoveScene().

Referenced by ProcessScheduledScenes().

void KX_KetsjiEngine::Render ( )
void KX_KetsjiEngine::RenderDome ( void  )
void KX_KetsjiEngine::ReplaceScene ( const STR_String oldscene,
const STR_String newscene 
)

Definition at line 1705 of file KX_KetsjiEngine.cpp.

Referenced by KX_SceneActuator::Update().

void KX_KetsjiEngine::ReplaceScheduledScenes ( void  ) [protected]
void KX_KetsjiEngine::RequestExit ( int  exitrequestmode)

Definition at line 964 of file KX_KetsjiEngine.cpp.

Referenced by KX_GameActuator::Update().

void KX_KetsjiEngine::ResumeScene ( const STR_String scenename)

Definition at line 1756 of file KX_KetsjiEngine.cpp.

References FindScene(), and KX_Scene::Resume().

Referenced by KX_SceneActuator::Update().

void KX_KetsjiEngine::SceneListsChanged ( void  ) [protected]

This method is invoked when the scene lists have changed.

Definition at line 1909 of file KX_KetsjiEngine.cpp.

References SCA_IScene::GetDebugProperties().

Referenced by AddScene(), and ProcessScheduledScenes().

void KX_KetsjiEngine::SetAnimFrameRate ( double  framerate) [static]

Sets the framerate for playing animations. (actions and ipos)

Definition at line 1851 of file KX_KetsjiEngine.cpp.

Referenced by GPG_Application::startEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::SetAnimRecordMode ( bool  animation_record,
int  startFrame 
)

Definition at line 1770 of file KX_KetsjiEngine.cpp.

Referenced by StartKetsjiShell().

void KX_KetsjiEngine::SetCameraOverrideClipping ( float  near,
float  far 
)

Definition at line 1093 of file KX_KetsjiEngine.cpp.

Referenced by StartKetsjiShell().

void KX_KetsjiEngine::SetCameraOverrideLens ( float  lens)

Definition at line 1099 of file KX_KetsjiEngine.cpp.

Referenced by StartKetsjiShell().

void KX_KetsjiEngine::SetCameraOverrideProjectionMatrix ( const MT_CmMatrix4x4 mat)

Definition at line 1082 of file KX_KetsjiEngine.cpp.

Referenced by StartKetsjiShell().

void KX_KetsjiEngine::SetCameraOverrideUseOrtho ( bool  useOrtho)

Definition at line 1075 of file KX_KetsjiEngine.cpp.

Referenced by StartKetsjiShell().

void KX_KetsjiEngine::SetCameraOverrideViewMatrix ( const MT_CmMatrix4x4 mat)

Definition at line 1088 of file KX_KetsjiEngine.cpp.

Referenced by StartKetsjiShell().

void KX_KetsjiEngine::SetCameraZoom ( float  camzoom)

Definition at line 1068 of file KX_KetsjiEngine.cpp.

Referenced by StartKetsjiShell().

void KX_KetsjiEngine::SetCanvas ( RAS_ICanvas canvas)

Definition at line 226 of file KX_KetsjiEngine.cpp.

References MT_assert.

Referenced by GPG_Application::initEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::SetDrawType ( int  drawingtype)

Definition at line 1053 of file KX_KetsjiEngine.cpp.

Referenced by StartKetsjiShell().

void KX_KetsjiEngine::SetExitKey ( short  key) [static]

Definition at line 1861 of file KX_KetsjiEngine.cpp.

Referenced by GPG_Application::initEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::SetGlobalSettings ( GlobalSettings gs)
void KX_KetsjiEngine::SetHideCursor ( bool  hideCursor)

Sets cursor hiding on every frame.

Parameters:
hideCursorTurns hiding on or off.

Definition at line 1923 of file KX_KetsjiEngine.cpp.

void KX_KetsjiEngine::SetKeyboardDevice ( SCA_IInputDevice keyboarddevice)

Definition at line 203 of file KX_KetsjiEngine.cpp.

References MT_assert.

Referenced by GPG_Application::initEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::SetMaxLogicFrame ( int  frame) [static]

Sets the maximum number of logic frame before render frame

Definition at line 1806 of file KX_KetsjiEngine.cpp.

void KX_KetsjiEngine::SetMaxPhysicsFrame ( int  frame) [static]

Sets the maximum number of physics frame before render frame

Definition at line 1816 of file KX_KetsjiEngine.cpp.

void KX_KetsjiEngine::SetMouseDevice ( SCA_IInputDevice mousedevice)

Definition at line 211 of file KX_KetsjiEngine.cpp.

References MT_assert.

Referenced by GPG_Application::initEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::SetNameNextGame ( const STR_String nextgame)

Definition at line 971 of file KX_KetsjiEngine.cpp.

Referenced by KX_GameActuator::Update().

void KX_KetsjiEngine::SetNetworkDevice ( NG_NetworkDeviceInterface networkdevice)

Definition at line 219 of file KX_KetsjiEngine.cpp.

References MT_assert.

Referenced by GPG_Application::initEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::SetOverrideFrameColor ( float  r,
float  g,
float  b 
)

Set the color used for framing bar color instead of the one in the Blender file's scenes.

Parameters:
rRed component of the override color.
gGreen component of the override color.
bBlue component of the override color.

Definition at line 1947 of file KX_KetsjiEngine.cpp.

References g.

void KX_KetsjiEngine::SetRasterizer ( RAS_IRasterizer rasterizer)

Definition at line 242 of file KX_KetsjiEngine.cpp.

References MT_assert.

Referenced by GPG_Application::initEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::SetRenderTools ( RAS_IRenderTools rendertools)

Definition at line 234 of file KX_KetsjiEngine.cpp.

References MT_assert.

Referenced by GPG_Application::initEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::SetRestrictAnimationFPS ( bool  bRestrictAnimFPS) [static]

Sets whether or not to lock animation updates to the animframerate

Definition at line 1826 of file KX_KetsjiEngine.cpp.

Referenced by GPG_Application::initEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::SetSceneConverter ( KX_ISceneConverter sceneconverter)

Definition at line 261 of file KX_KetsjiEngine.cpp.

References MT_assert.

Referenced by GPG_Application::startEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::SetTicRate ( double  ticrate) [static]

Sets the number of logic updates per second.

Definition at line 1796 of file KX_KetsjiEngine.cpp.

void KX_KetsjiEngine::SetTimingDisplay ( bool  frameRate,
bool  profile,
bool  properties 
)

Activates or deactivates timing information display.

Parameters:
frameRateDisplay for frame rate on or off.
profileDisplay for individual components on or off.
propertiesDisplay of scene object debug properties on or off.

Definition at line 1871 of file KX_KetsjiEngine.cpp.

Referenced by GPG_Application::initEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::SetUseFixedTime ( bool  bUseFixedTime)

Sets display of all frames.

Parameters:
bUseFixedTimeNew setting for display all frames.

Definition at line 1764 of file KX_KetsjiEngine.cpp.

Referenced by GPG_Application::initEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::SetUseOverrideFrameColor ( bool  overrideFrameColor)

Enables/disables the use of the framing bar color of the Blender file's scenes.

Parameters:
overrideFrameColorThe new setting.

Definition at line 1935 of file KX_KetsjiEngine.cpp.

void KX_KetsjiEngine::SetWorldSettings ( KX_WorldInfo worldinfo)
void KX_KetsjiEngine::StartEngine ( bool  clearIpo)

Ketsji Init(), Initializes datastructures and converts data from Blender into Ketsji native (realtime) format also sets up the graphics context

Definition at line 400 of file KX_KetsjiEngine.cpp.

References DEFAULT_LOGIC_TIC_RATE, KX_ISystem::GetTimeInSeconds(), Scene::gm, GameData::maxlogicstep, GameData::maxphystep, KX_ISceneConverter::ResetPhysicsObjectsAnimationIpo(), GameData::ticrate, and KX_ISceneConverter::WritePhysicsObjectToAnimationIpo().

Referenced by GPG_Application::startEngine(), and StartKetsjiShell().

void KX_KetsjiEngine::StopEngine ( )
void KX_KetsjiEngine::SuspendScene ( const STR_String scenename)

Definition at line 1748 of file KX_KetsjiEngine.cpp.

References FindScene(), and KX_Scene::Suspend().

Referenced by KX_SceneActuator::Update().


Member Data Documentation

Definition at line 240 of file KX_KetsjiEngine.h.

Referenced by InitDome(), Render(), and ~KX_KetsjiEngine().


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