SO3Engine
|
SO3ViewPort.cpp
Go to the documentation of this file.
27 SViewPort::SViewPort(SWindow* parent, SCamera* camera, int priority, const float& x, const float& y, const float& w, const float& h)
31 Ogre::RenderWindow* renderWindow = const_cast <Ogre::RenderWindow*> (const_cast <SWindow*> (scolWindow)->GetOgreRenderWindowPointer());
44 // set default visibility mask to 0xfffe keep the last bit to be invisible by default in viewports
54 Ogre::LogManager::getSingleton().getDefaultLog()->logMessage("An exception has occurred: " + e.getDescription());
94 const_cast <Ogre::RenderWindow*> (const_cast <SWindow*> (scolWindow)->GetOgreRenderWindowPointer())->removeViewport(O3ViewPort->getZOrder());
131 void SViewPort::SetPositionAndSize(const float& x, const float& y, const float& w, const float& h)
133 O3ViewPort->setDimensions(static_cast <Ogre::Real> (x), static_cast <Ogre::Real> (y), static_cast <Ogre::Real> (w), static_cast <Ogre::Real> (h));
148 MMechostr(MSKDEBUG, "SO3ViewportResize %i %i %f %f\n", rw, rh, (float)w / (float)rw, (float)h / (float)rh);
149 SetPositionAndSize(O3ViewPort->getLeft(), O3ViewPort->getTop(), (float)w / (float)rw, (float)h / (float)rh);
256 Ogre::RTShader::ShaderGenerator::getSingletonPtr()->invalidateScheme(O3ViewPort->getMaterialScheme());
633 SCompositor* SViewPort::CreateCompositor(const std::string& newCompositorName, const std::string& newSchemeName)
734 SRaycastResult SViewPort::RayCast(const int& pixelsX, const int& pixelsY, SSubEntitySelectorBuffer* subEntitySelector)
738 float xR = (static_cast <float> (pixelsX - GetLeftPixels())) / (static_cast <float> (GetWidthPixels()));
739 float yR = (static_cast <float> (pixelsY - GetTopPixels())) / (static_cast <float> (GetHeightPixels()));
767 Ogre::Matrix4 invViewMat = (camera->getProjectionMatrix() * camera->getViewMatrix(true)).inverse();
780 Ogre::Vector4 viewpos = camera->getProjectionMatrixWithRSDepth().inverse() * Ogre::Vector4(nx, ny, zdepth, 1.0f);
795 // A B C triangle : tan(fov / 2) gives AB : AC is depth : then use pythagore to get hypotenuse BC
823 //MMechostr(MSKDEBUG, ">>>>>> RayCast : Entity found > %s\n", subEntity->getParent()->getName().c_str());
840 SMaterial* mat = scene->GetMaterial(entity->GetGroupName(), subEntity->getMaterial()->getName());
856 else if (scolWindow->GetSelectorMode() == SWindow::SO3_SELECTOR_LIMITED) // position only on widgets
861 SMaterial* mat = scene->GetMaterial(entity->GetGroupName(), subEntity->getMaterial()->getName());
876 float xR = (static_cast <float> (pixelsX - GetLeftPixels())) / (static_cast <float> (GetWidthPixels()));
877 float yR = (static_cast <float> (pixelsY - GetTopPixels())) / (static_cast <float> (GetHeightPixels()));
907 float xR = (static_cast <float> (pixelsX - GetLeftPixels())) / (static_cast <float> (GetWidthPixels()));
908 float yR = (static_cast <float> (pixelsY - GetTopPixels())) / (static_cast <float> (GetHeightPixels()));
929 Ogre::Vector3 SViewPort::RayCastCamera(const int& pixelsX, const int& pixelsY, const float distance, Ogre::Vector3 &outDirection)
932 OGRE_EXCEPT(Ogre::Exception::ERR_INVALID_STATE, "There is now active camera on viewport", "SViewPort::RayCastCamera");
934 float xR = (static_cast <float> (pixelsX - GetLeftPixels())) / (static_cast <float> (GetWidthPixels()));
935 float yR = (static_cast <float> (pixelsY - GetTopPixels())) / (static_cast <float> (GetHeightPixels()));
971 Ogre::Technique* SViewPort::handleSchemeNotFound(unsigned short schemeIndex, const Ogre::String& schemeName, Ogre::Material* originalMaterial, unsigned short lodIndex, const Ogre::Renderable* rend)
973 MMechostr(MSKDEBUG, ">>>>>>>>> Material scheme missed : %s for material : %s\n", schemeName.c_str(), originalMaterial->getName().c_str());
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
static Ogre::ColourValue ScolToOgreColorRGBA(const int &scolColor)
Definition SO3ConversionTools.cpp:126
static int OgreToScolColorRGBA(const Ogre::ColourValue &ogreColor)
Definition SO3ConversionTools.cpp:115
Definition SO3Camera.h:43
void SetCurrentViewPort(SViewPort *mViewPort)
Definition SO3Camera.cpp:60
Definition SO3Compositor.h:43
Definition SO3DeferredShading.h:59
void SetAntiAliasing(SViewPort *existingViewport, DeferredShadingAntiAliasingMode newMode)
Definition SO3DeferredShading.cpp:332
DeferredShadingAntiAliasingMode
Definition SO3DeferredShading.h:76
void SetSSAO(SViewPort *existingViewport, bool ssao)
Definition SO3DeferredShading.cpp:320
void UnregisterViewport(SViewPort *existingViewport)
Definition SO3DeferredShading.cpp:241
void RegisterViewport(SViewPort *targetViewport)
Definition SO3DeferredShading.cpp:150
DeferredShadingMode GetMode() const
Definition SO3DeferredShading.cpp:351
void SetMode(DeferredShadingMode mode)
Definition SO3DeferredShading.cpp:286
Definition SO3Entity.h:43
Definition SO3HdrHandler.h:41
Definition SO3Material.h:43
virtual Ogre::Vector3 GetGlobalPosition()
Definition SO3NodeScol.cpp:649
static SRaycastResult Cast(SCamera *camera, const float &relativePosX, const float &relativePosY, Ogre::SubEntity *subEntity, bool getUvCoordonate=false)
Definition SO3RayCast.cpp:200
Definition SO3RayCast.h:41
Definition SO3Scene.h:125
SMaterial * GetMaterial(const std::string &groupName, const std::string &materialName, bool searchOtherGroups=true)
Definition SO3Scene.cpp:1099
void GetSimpleRayCast(Ogre::Ray cameraRay, SRaycastResult &result)
Definition SO3Scene.cpp:2232
Definition SO3SsaoHandler.h:40
float GetSelectedZdepth(int posX, int posY)
Definition SO3SubEntitySelectorBuffer.cpp:349
bool UseDepthBuffer()
Definition SO3SubEntitySelectorBuffer.cpp:272
Ogre::SubEntity * GetSelectedSubEntity(int posX, int posY)
Definition SO3SubEntitySelectorBuffer.cpp:277
void SetVisibilityMaskIndexEnable(const Ogre::uint32 flagIndex, const bool enable)
Definition SO3ViewPort.cpp:583
void SetVisibilityMask(const Ogre::uint32 &mask)
Definition SO3ViewPort.cpp:571
void AddCompositor(SCompositor *existingCompositor)
Definition SO3ViewPort.cpp:669
void SetDeferredEnable(const bool &value)
Definition SO3ViewPort.cpp:411
bool GetVisibilityMaskIndexEnable(const Ogre::uint32 flagIndex)
Definition SO3ViewPort.cpp:597
SCompositor * GetCompositor(const std::string &compositorName)
Definition SO3ViewPort.cpp:619
void SetPositionAndSize(const float &x, const float &y, const float &w, const float &h)
Definition SO3ViewPort.cpp:131
void UnregisterStereoViewport()
Definition SO3ViewPort.cpp:319
Ogre::Vector3 RayCastCamera(const int &pixelsX, const int &pixelsY, const float distance, Ogre::Vector3 &outDirection)
Definition SO3ViewPort.cpp:928
void SetShadowsEnabled(const bool &enableShadows)
Definition SO3ViewPort.cpp:203
void SetMaterialScheme(const std::string &existingScheme)
Definition SO3ViewPort.cpp:118
void SetOverlayEnable(const bool &value)
Definition SO3ViewPort.cpp:399
void SetDeferredDebugMode(const int &value)
Definition SO3ViewPort.cpp:469
SDeferredShading::DeferredShadingAntiAliasingMode GetDeferredAntiAliasingMode()
Definition SO3ViewPort.cpp:464
void SetHDREffectAmount(const float &value)
Definition SO3ViewPort.cpp:559
bool IsStereoViewportRegistered()
Definition SO3ViewPort.cpp:329
void ResizeToWindow(const float &w, const float &h)
Definition SO3ViewPort.cpp:137
unsigned int GetNumRenderedBatches()
Definition SO3ViewPort.cpp:1028
SRaycastResult RayCast(const int &pixelsX, const int &pixelsY, SSubEntitySelectorBuffer *subEntitySelector)
Definition SO3ViewPort.cpp:733
void SetBackgroundColour(const int &backgroundColor)
Definition SO3ViewPort.cpp:209
void UpdateStereoCamera(Ogre::Camera *camera)
Definition SO3ViewPort.cpp:304
const SCompositorMap & GetCompositorList() const
Definition SO3ViewPort.cpp:628
void RemoveCompositor(SCompositor *existingCompositor)
Definition SO3ViewPort.cpp:684
Ogre::Viewport * GetOgreViewPortPointer()
Definition SO3ViewPort.cpp:98
SCompositor * CreateCompositor(const std::string &newCompositorName, const std::string &newSchemeName)
Definition SO3ViewPort.cpp:633
void SetDeferredAntiAliasingMode(const SDeferredShading::DeferredShadingAntiAliasingMode &value)
Definition SO3ViewPort.cpp:448
void UpdateStereoCameraMatrix(Ogre::Camera *camera)
Definition SO3ViewPort.cpp:314
void SetHDRBlurAmount(const float &value)
Definition SO3ViewPort.cpp:553
virtual Ogre::Technique * handleSchemeNotFound(unsigned short schemeIndex, const Ogre::String &schemeName, Ogre::Material *originalMaterial, unsigned short lodIndex, const Ogre::Renderable *rend)
Definition SO3ViewPort.cpp:970
bool GetScreenPosFromWorldPos(Ogre::Vector3 worldPosition, Ogre::Vector2 &screenPos)
Definition SO3ViewPort.cpp:703
bool UpdateStereoCompositorState(const Ogre::String compname, bool state)
Definition SO3ViewPort.cpp:299
virtual void viewportDimensionsChanged(Ogre::Viewport *viewport)
Definition SO3ViewPort.cpp:940
void DeleteCompositor(SCompositor *existingCompositor)
Definition SO3ViewPort.cpp:649
Definition SO3Window.h:45
void RegisterStereoViewport(SViewPort *viewport)
Definition SO3Window.cpp:528
bool UpdateStereoCompositorState(SViewPort *viewport, const Ogre::String compname, bool state)
Definition SO3Window.cpp:499
void UpdateStereoCameraMatrix(SViewPort *viewport, Ogre::Camera *camera)
Definition SO3Window.cpp:516
void UpdateStereoCamera(SViewPort *viewport, Ogre::Camera *camera)
Definition SO3Window.cpp:510
Ogre::RenderWindow * GetOgreRenderWindowPointer()
Definition SO3Window.cpp:441
void RestoreStereoCamera(SViewPort *viewport)
Definition SO3Window.cpp:504
void SynchStereoViewportSetup(SViewPort *viewport, bool overlay=false, bool shadow=false)
Definition SO3Window.cpp:534
void UnregisterStereoViewport(SViewPort *viewport)
Definition SO3Window.cpp:522
bool IsStereoViewportRegistered(SViewPort *viewport)
Definition SO3Window.cpp:540
SRaycastResult RayCast(const int &pixelsX, const int &pixelsY)
Definition SO3Window.cpp:1210
void RefreshSelector(const bool &forceRefresh=false)
Definition SO3Window.cpp:327
Definition SO3DataScol.h:38
std::unordered_map< std::string, SCompositor * > SCompositorMap
Definition SO3Prerequisites.h:267
Generated by 1.9.8