Lugre::cOgreWrapper Class Reference

#include <lugre_ogrewrapper.h>

List of all members.

Public Member Functions

 cOgreWrapper ()
Ogre::SceneManager * GetSceneManager (const char *szSceneMgrName="main")
std::vector< std::string > ListRenderSystems ()
void SetRenderSystemByName (std::string sRenderSysName)
std::vector< std::string > ListConfigOptionNames (std::string sRenderSysName)
std::vector< std::string > ListPossibleValuesForConfigOption (std::string sRenderSysName, std::string sConfigOptionName)
void SetConfigOption (std::string sName, std::string sValue)
std::string GetConfigOption (std::string sName)
bool Init (const char *szWindowTitle, const char *szOgrePluginDir, const char *szOgreBaseDir, bool bAutoCreateWindow=true)
 returns true on success
bool CreateOgreWindow (bool bConfigRestoreOrDialog=true)
void RenderOneFrame ()
void DeInit ()
void TakeGridScreenshot (const int &pGridSize, const Ogre::String &pFileName, const Ogre::String &pFileExtention, const bool &pStitchGridImages)
void TakeScreenshot (const char *szPrefix="../screenshots/")
 szPrefix can be something like "mydir/sfz_"
void SetSkybox (const char *szMatName, const bool bFlip=false)
void AttachCamera (Ogre::SceneNode *pSceneNode=0)
void SetCameraPos (const Ogre::Vector3 vPos=Ogre::Vector3::ZERO)
void SetCameraRot (const Ogre::Quaternion qRot=Ogre::Quaternion::IDENTITY)
void CameraLookAt (const Ogre::Vector3 vPos=Ogre::Vector3::ZERO)
int GetViewportHeight ()
 in pixels
int GetViewportWidth ()
 in pixels
int GetEntityIndexCount (Ogre::Entity *pEntity)
Ogre::Vector3 GetEntityVertex (Ogre::Entity *pEntity, const int iIndexIndex)
bool RayAABBQuery (const Ogre::Vector3 &vRayPos, const Ogre::Vector3 &vRayDir, const Ogre::AxisAlignedBox &aabb, float *pfHitDist=0, int *pfHitFaceNormalX=0, int *pfHitFaceNormalY=0, int *pfHitFaceNormalZ=0)
int RayEntityQuery (const Ogre::Vector3 &vRayPos, const Ogre::Vector3 &vRayDir, Ogre::Entity *pEntity, float *pfHitDist=0)
int RayEntityQuery (const Ogre::Vector3 &vRayPos, const Ogre::Vector3 &vRayDir, Ogre::Entity *pEntity, const Ogre::Vector3 &vPos, const Ogre::Quaternion &qRot, const Ogre::Vector3 &vScale, float *pfHitDist=0)
void RayEntityQuery (const Ogre::Vector3 &vRayPos, const Ogre::Vector3 &vRayDir, Ogre::Entity *pEntity, std::vector< std::pair< float, int > > &pHitList)
void RayEntityQuery (const Ogre::Vector3 &vRayPos, const Ogre::Vector3 &vRayDir, Ogre::Entity *pEntity, const Ogre::Vector3 &vPos, const Ogre::Quaternion &qRot, const Ogre::Vector3 &vScale, std::vector< std::pair< float, int > > &pHitList)
bool ProjectPos (const Ogre::Vector3 &pos, Ogre::Real &x, Ogre::Real &y)
bool ProjectSizeAndPos (const Ogre::Vector3 &pos, Ogre::Real &x, Ogre::Real &y, const Ogre::Real rad, Ogre::Real &cx, Ogre::Real &cy)
Ogre::Vector3 ProjectSizeAndPosEx (const Ogre::Vector3 &pos, const Ogre::Real rad, Ogre::Vector3 &vSize)

Static Public Member Functions

static cOgreWrapperGetSingleton ()
static std::string GetUniqueName ()
static Ogre::Bone * SearchBoneByName (Ogre::Skeleton &pSkeleton, const char *szBoneName)
 unlike Ogre::Skeleton::getBone(sName) this does NOT throw an exception
static void ImageBlit (Ogre::Image &pImageS, Ogre::Image &pImageD, const int tx0, const int ty0)
static void ImageBlitPart (Ogre::Image &pImageS, Ogre::Image &pImageD, int dst_x, int dst_y, int src_x, int src_y, int w, int h)
static void ImageColorReplace (Ogre::Image &pImage, Ogre::ColourValue colSearch, Ogre::ColourValue colReplace)
static void ImageColorKeyToAlpha (Ogre::Image &pImage, Ogre::ColourValue colSearch)

Public Attributes

Ogre::Root * mRoot
Ogre::Camera * mCamera
Ogre::Viewport * mViewport
Ogre::SceneManager * mSceneMgr
Ogre::RenderWindow * mWindow
Ogre::SceneNode * mpCamPosSceneNode
Ogre::SceneNode * mpCamHolderSceneNode
std::string msWindowTitle
float mfLastFPS
float mfAvgFPS
float mfBestFPS
float mfWorstFPS
unsigned long miBestFrameTime
unsigned long miWorstFrameTime
size_t miTriangleCount
size_t miBatchCount
OIS::InputManager * mInputManager
OIS::Mouse * mMouse
OIS::Keyboard * mKeyboard
OIS::JoyStick * mJoy


Detailed Description

Definition at line 64 of file lugre_ogrewrapper.h.


Constructor & Destructor Documentation

Lugre::cOgreWrapper::cOgreWrapper (  ) 


Member Function Documentation

static cOgreWrapper& Lugre::cOgreWrapper::GetSingleton (  )  [inline, static]

Definition at line 93 of file lugre_ogrewrapper.h.

Referenced by Lugre::cGfx3D::Clear(), Lugre::cMaterial_L::CloneMaterial(), Lugre::cCamera_L::CreateCamera(), Lugre::cGfx3D_L::CreateCamPosGfx3D(), Lugre::cGfx3D_L::CreateCockpitGfx3D(), Lugre::cGfx3D_L::CreateGfx3D(), Lugre::cMaterial_L::CreateMaterial(), CreateOgreWindow(), Lugre::cRenderManager2D_L::CreateRenderManager2D(), Lugre::cRenderTexture_L::CreateRenderTexture(), Lugre::cGfx3D_L::CreateRootGfx3D(), Lugre::cGfx3D::DestroyPath(), Lugre::FreeOldUnusedParticleSystems(), Lugre::cGfx3D_L::GetEntityIndexCount(), Lugre::cGfx3D_L::GetEntityVertex(), Lugre::cColourClipTextOverlay::GetGlyphAtPos(), Lugre::cColourClipTextOverlay::GetGlyphBounds(), Lugre::cCamera_L::GetMainCam(), Lugre::cViewport_L::GetMainViewport(), Lugre::cColourClipTextOverlay::GetTextBounds(), Lugre::cTexAtlas_L::MakeTexture(), Lugre::cImage_L::MakeTexture(), Lugre::cMyOISListener::mouseMoved(), Lugre::cGfx3D::NewFree(), Lugre::OgreForceCloseFullscreen(), Lugre::cGfx2D::PrepareFrameStep(), Lugre::PushUnusedParticleSystem(), Lugre::cGfx3D_L::RayPick(), Lugre::cGfx3D_L::RayPickList(), Lugre::cLugreLuaBind_Ogre_Image::RegisterMethods(), Lugre::cLugreLuaBind_Ogre_SceneManager::RegisterMethods(), Lugre::cGfx3D_L::RenderableConvertToMesh(), Lugre::cGame::RenderOneFrame(), Lugre::cGame::Run(), Lugre::cMaterial_L::SaveTextureToFile(), Lugre::cGfx3D::SetBillboard(), Lugre::cGfx3D::SetMesh(), Lugre::cGfx3D::SetParticleSystem(), Lugre::cGfx3D_L::SetPath(), Lugre::cGfx3D_L::SetRootAsParent(), Lugre::cGfx3D::SetTextFont(), Lugre::cGfx3D::SetTrail(), Lugre::cRadar::Step(), Lugre::cGfx3D::UpdateProjected(), Lugre::cColourClipTextOverlay::UpdateVars(), and Lugre::cGfx3D::~cGfx3D().

Ogre::SceneManager * Lugre::cOgreWrapper::GetSceneManager ( const char *  szSceneMgrName = "main"  ) 

std::vector< std::string > Lugre::cOgreWrapper::ListRenderSystems (  ) 

Definition at line 403 of file lugre_ogrewrapper.cpp.

References mRoot.

void Lugre::cOgreWrapper::SetRenderSystemByName ( std::string  sRenderSysName  ) 

Definition at line 423 of file lugre_ogrewrapper.cpp.

References mRoot.

std::vector< std::string > Lugre::cOgreWrapper::ListConfigOptionNames ( std::string  sRenderSysName  ) 

Definition at line 430 of file lugre_ogrewrapper.cpp.

References mRoot.

std::vector< std::string > Lugre::cOgreWrapper::ListPossibleValuesForConfigOption ( std::string  sRenderSysName,
std::string  sConfigOptionName 
)

Definition at line 442 of file lugre_ogrewrapper.cpp.

References mRoot.

void Lugre::cOgreWrapper::SetConfigOption ( std::string  sName,
std::string  sValue 
)

Definition at line 454 of file lugre_ogrewrapper.cpp.

References mRoot.

std::string Lugre::cOgreWrapper::GetConfigOption ( std::string  sName  ) 

Definition at line 461 of file lugre_ogrewrapper.cpp.

References mRoot.

bool Lugre::cOgreWrapper::Init ( const char *  szWindowTitle,
const char *  szOgrePluginDir,
const char *  szOgreBaseDir,
bool  bAutoCreateWindow = true 
)

bool Lugre::cOgreWrapper::CreateOgreWindow ( bool  bConfigRestoreOrDialog = true  ) 

void Lugre::cOgreWrapper::RenderOneFrame (  ) 

void Lugre::cOgreWrapper::DeInit (  ) 

Definition at line 757 of file lugre_ogrewrapper.cpp.

References mRoot, and PROFILE.

Referenced by Lugre::cGame::Run().

void Lugre::cOgreWrapper::TakeGridScreenshot ( const int &  pGridSize,
const Ogre::String &  pFileName,
const Ogre::String &  pFileExtention,
const bool &  pStitchGridImages 
)

highres screenshot from wiki http://www.ogre3d.org/wiki/index.php/High_resolution_screenshots

Definition at line 796 of file lugre_ogrewrapper.cpp.

References mCamera, mViewport, and mWindow.

void Lugre::cOgreWrapper::TakeScreenshot ( const char *  szPrefix = "../screenshots/"  ) 

szPrefix can be something like "mydir/sfz_"

Definition at line 917 of file lugre_ogrewrapper.cpp.

References Lugre::cShell::GetTicks(), mWindow, PROFILE, and Lugre::strprintf().

void Lugre::cOgreWrapper::SetSkybox ( const char *  szMatName,
const bool  bFlip = false 
)

Definition at line 761 of file lugre_ogrewrapper.cpp.

References mSceneMgr, and PROFILE.

void Lugre::cOgreWrapper::AttachCamera ( Ogre::SceneNode *  pSceneNode = 0  ) 

void Lugre::cOgreWrapper::SetCameraPos ( const Ogre::Vector3  vPos = Ogre::Vector3::ZERO  ) 

Definition at line 782 of file lugre_ogrewrapper.cpp.

References mCamera, and PROFILE.

void Lugre::cOgreWrapper::SetCameraRot ( const Ogre::Quaternion  qRot = Ogre::Quaternion::IDENTITY  ) 

void Lugre::cOgreWrapper::CameraLookAt ( const Ogre::Vector3  vPos = Ogre::Vector3::ZERO  ) 

Definition at line 790 of file lugre_ogrewrapper.cpp.

References mCamera, and PROFILE.

std::string Lugre::cOgreWrapper::GetUniqueName (  )  [static]

int Lugre::cOgreWrapper::GetViewportHeight (  ) 

in pixels

avoid using OverlayManager::getSingleton().GetViewportHeight() as it is one frame late

Definition at line 931 of file lugre_ogrewrapper.cpp.

References mViewport.

Referenced by Lugre::cColourClipTextOverlay::GetTextBounds(), cLocation_L::Intersect2DRect(), Lugre::cGfx2D::PrepareFrameStep(), and Lugre::cColourClipTextOverlay::UpdateVars().

int Lugre::cOgreWrapper::GetViewportWidth (  ) 

int Lugre::cOgreWrapper::GetEntityIndexCount ( Ogre::Entity *  pEntity  ) 

Ogre::Vector3 Lugre::cOgreWrapper::GetEntityVertex ( Ogre::Entity *  pEntity,
const int  iIndexIndex 
)

bool Lugre::cOgreWrapper::RayAABBQuery ( const Ogre::Vector3 &  vRayPos,
const Ogre::Vector3 &  vRayDir,
const Ogre::AxisAlignedBox &  aabb,
float *  pfHitDist = 0,
int *  pfHitFaceNormalX = 0,
int *  pfHitFaceNormalY = 0,
int *  pfHitFaceNormalZ = 0 
)

Definition at line 935 of file lugre_ogrewrapper.cpp.

References Lugre::IntersectRayTriangle(), and PROFILE.

Referenced by Lugre::cGfx3D_L::RayPick().

int Lugre::cOgreWrapper::RayEntityQuery ( const Ogre::Vector3 &  vRayPos,
const Ogre::Vector3 &  vRayDir,
Ogre::Entity *  pEntity,
float *  pfHitDist = 0 
)

returns face index that was hit, or -1 if nothing hit extracs pos & rot from scenenode, DOESNT WORK FOR entities in static geometry (no scenenode)

Definition at line 1028 of file lugre_ogrewrapper.cpp.

References PROFILE.

Referenced by RayEntityQuery(), Lugre::cGfx3D_L::RayPick(), and Lugre::cGfx3D_L::RayPickList().

int Lugre::cOgreWrapper::RayEntityQuery ( const Ogre::Vector3 &  vRayPos,
const Ogre::Vector3 &  vRayDir,
Ogre::Entity *  pEntity,
const Ogre::Vector3 &  vPos,
const Ogre::Quaternion &  qRot,
const Ogre::Vector3 &  vScale,
float *  pfHitDist = 0 
)

returns face index that was hit, or -1 if nothing hit the resulting distance in the case of a hit is stored into pfHitDist see also OgreOpCode for more complex collision/intersection detection

Definition at line 1016 of file lugre_ogrewrapper.cpp.

References Lugre::MeshShape::GetMeshShape(), PROFILE, and Lugre::MeshShape::RayIntersect().

void Lugre::cOgreWrapper::RayEntityQuery ( const Ogre::Vector3 &  vRayPos,
const Ogre::Vector3 &  vRayDir,
Ogre::Entity *  pEntity,
std::vector< std::pair< float, int > > &  pHitList 
)

Definition at line 1034 of file lugre_ogrewrapper.cpp.

References RayEntityQuery().

void Lugre::cOgreWrapper::RayEntityQuery ( const Ogre::Vector3 &  vRayPos,
const Ogre::Vector3 &  vRayDir,
Ogre::Entity *  pEntity,
const Ogre::Vector3 &  vPos,
const Ogre::Quaternion &  qRot,
const Ogre::Vector3 &  vScale,
std::vector< std::pair< float, int > > &  pHitList 
)

bool Lugre::cOgreWrapper::ProjectPos ( const Ogre::Vector3 &  pos,
Ogre::Real &  x,
Ogre::Real &  y 
)

returns true if in front of cam, and fills x,y with clamped screencoords in [-1;1] and fills cx,cy with projected size on screen in [0;1]

Definition at line 1054 of file lugre_ogrewrapper.cpp.

References mCamera, and PROFILE.

bool Lugre::cOgreWrapper::ProjectSizeAndPos ( const Ogre::Vector3 &  pos,
Ogre::Real &  x,
Ogre::Real &  y,
const Ogre::Real  rad,
Ogre::Real &  cx,
Ogre::Real &  cy 
)

returns true if in front of cam, and fills x,y with clamped screencoords in [-1;1] and fills cx,cy with projected size on screen in [0;1]

Definition at line 1076 of file lugre_ogrewrapper.cpp.

References mCamera, and PROFILE.

Referenced by cLocation_L::Intersect2DRect().

Ogre::Vector3 Lugre::cOgreWrapper::ProjectSizeAndPosEx ( const Ogre::Vector3 &  pos,
const Ogre::Real  rad,
Ogre::Vector3 &  vSize 
)

returns projected pos (not clamped) and size in vSize (usually [0,1] if on screen) pos.z is screenspace, size.z is eyespace-z (< 0 means in front of cam)

Definition at line 1109 of file lugre_ogrewrapper.cpp.

References mCamera, and PROFILE.

Referenced by Lugre::cGfx3D::UpdateProjected().

Ogre::Bone * Lugre::cOgreWrapper::SearchBoneByName ( Ogre::Skeleton &  pSkeleton,
const char *  szBoneName 
) [static]

unlike Ogre::Skeleton::getBone(sName) this does NOT throw an exception

Definition at line 1123 of file lugre_ogrewrapper.cpp.

Referenced by Lugre::cGfx3D::HasBone(), and Lugre::cLugreLuaBind_Ogre_Skeleton::RegisterMethods().

void Lugre::cOgreWrapper::ImageBlit ( Ogre::Image &  pImageS,
Ogre::Image &  pImageD,
const int  tx0,
const int  ty0 
) [static]

blits an image to another, optimized transfer(memcpy) if both have the same pixel format, on the fly convert otherwise result undefined if pImageS == pImageD (due to copy order, and memcpy)

Definition at line 1139 of file lugre_ogrewrapper.cpp.

References Lugre::mymax(), and Lugre::mymin().

Referenced by Lugre::cImage_L::ImageBlit().

void Lugre::cOgreWrapper::ImageBlitPart ( Ogre::Image &  pImageS,
Ogre::Image &  pImageD,
int  dst_x,
int  dst_y,
int  src_x,
int  src_y,
int  w,
int  h 
) [static]

blits an image to another, optimized transfer(memcpy) if both have the same pixel format, on the fly convert otherwise result undefined if pImageS == pImageD and area overlapping (due to copy order, and memcpy)

Definition at line 1202 of file lugre_ogrewrapper.cpp.

Referenced by Lugre::cLugreLuaBind_Ogre_Image::RegisterMethods(), and Lugre::cImage_L::RegisterMethods().

void Lugre::cOgreWrapper::ImageColorReplace ( Ogre::Image &  pImage,
Ogre::ColourValue  colSearch,
Ogre::ColourValue  colReplace 
) [static]

void Lugre::cOgreWrapper::ImageColorKeyToAlpha ( Ogre::Image &  pImage,
Ogre::ColourValue  colSearch 
) [static]


Member Data Documentation

Ogre::SceneManager* Lugre::cOgreWrapper::mSceneMgr

Ogre::RenderWindow* Lugre::cOgreWrapper::mWindow

Definition at line 70 of file lugre_ogrewrapper.h.

Referenced by CreateOgreWindow().

Definition at line 71 of file lugre_ogrewrapper.h.

Referenced by CreateOgreWindow().

Definition at line 74 of file lugre_ogrewrapper.h.

Referenced by CreateOgreWindow(), and Init().

Definition at line 75 of file lugre_ogrewrapper.h.

Referenced by cOgreWrapper(), and RenderOneFrame().

Definition at line 76 of file lugre_ogrewrapper.h.

Referenced by cOgreWrapper(), and RenderOneFrame().

Definition at line 77 of file lugre_ogrewrapper.h.

Referenced by cOgreWrapper(), and RenderOneFrame().

Definition at line 78 of file lugre_ogrewrapper.h.

Referenced by cOgreWrapper(), and RenderOneFrame().

Definition at line 79 of file lugre_ogrewrapper.h.

Referenced by cOgreWrapper(), and RenderOneFrame().

Definition at line 80 of file lugre_ogrewrapper.h.

Referenced by cOgreWrapper(), and RenderOneFrame().

Definition at line 81 of file lugre_ogrewrapper.h.

Referenced by cOgreWrapper(), and RenderOneFrame().

Definition at line 82 of file lugre_ogrewrapper.h.

Referenced by cOgreWrapper(), and RenderOneFrame().

OIS::JoyStick* Lugre::cOgreWrapper::mJoy


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

Generated on Tue May 22 06:00:42 2012 for cpp by  doxygen 1.5.6