SO3Engine
|
SO3SubEntitySelectorMaterialSwitcher.cpp
Go to the documentation of this file.
42 SSubEntitySelectorMaterialSwitcher::SSubEntitySelectorMaterialSwitcher(const std::string& baseResourceName, bool useDepth) : resetColour(0.0f, 0.0f, 0.0f)
45 materialTransparent = Ogre::MaterialManager::getSingleton().getByName(std::string(SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP) + "/Material/Transparent", SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP);
48 materialTransparent = materialTransparent->clone(baseResourceName + "/Material/Transparent", baseResourceName);
56 materialPlainColour = Ogre::MaterialManager::getSingleton().getByName(std::string(SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP) + matName, SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP);
64 materialPlainColour = Ogre::MaterialManager::getSingleton().getByName(std::string(SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP) + matName, SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP);
70 materialPlainColourSP = Ogre::MaterialManager::getSingleton().getByName(std::string(SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP) + matName + "SP", SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP);
77 materialPlainColourSP = materialPlainColourSP->clone(baseResourceName + matName + "SP", baseResourceName);
80 materialDots = materialPlainColour->clone(baseResourceName + matName + "_DOT", baseResourceName);
83 materialDotsSP = materialPlainColourSP->clone(baseResourceName + matName + "SP" + "_DOT", baseResourceName);
91 materialPlainColorForeground = Ogre::MaterialManager::getSingleton().getByName(std::string(SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP) + matName, SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP);
99 materialPlainColorForeground = Ogre::MaterialManager::getSingleton().getByName(std::string(SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP) + matName, SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP);
104 materialPlainColorForeground = materialPlainColorForeground->clone(baseResourceName + matName, baseResourceName);
107 materialPlainColorForegroundSP = Ogre::MaterialManager::getSingleton().getByName(std::string(SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP) + matName + "SP", SO3_INTERNAL_SUBENTITY_SELECTOR_RESOURCE_GROUP);
131 Ogre::Technique* SSubEntitySelectorMaterialSwitcher::handleSchemeNotFound(unsigned short schemeIndex, const Ogre::String& schemeName, Ogre::Material* originalMaterial, unsigned short lodIndex, const Ogre::Renderable* rend)
145 if ((originalMaterial->getNumTechniques() > 0) && (originalMaterial->getTechnique(0)->getNumPasses() > 0) && (!originalMaterial->getTechnique(0)->getPass(0)->getPolygonModeOverrideable()) && (originalMaterial->getTechnique(0)->getPass(0)->getPolygonMode() == Ogre::PM_POINTS))
154 Ogre::Any bindedSTechnique = originalMaterial->getTechnique(0)->getUserObjectBindings().getUserAny("STechnique");
167 // First, check if it's a subentity. We can know that cause we had an "UserObjectBinding" named "SEntity" to subentities when loading a mesh.
199 // Selection do not work correctly if fog is activated on the scene, cause fog is computed AFTER the pixel shader call!
213 // Store colour to renderable, this parameter will be used by the pixel shader to colorize the object.
215 lastRenderable->setCustomParameter(1, Ogre::Vector4(currentColour.r, currentColour.g, currentColour.b, 1.0f));
277 currentColour.setAsARGB(static_cast <Ogre::ARGB> (Ogre::Math::UnitRandom() * 0x00FFFFFF + 0xFF000000)); // ignore alpha
320 Ogre::SubEntity* SSubEntitySelectorMaterialSwitcher::GetSubEntity(const Ogre::ColourValue& searchedColour)
330 Ogre::SceneManager* sceneManager = Ogre::Root::getSingleton().getSceneManager(infos.sceneManagerName);
333 // Entity could have been destroyed and recreated with the same name since last rtt update, check this!
340 // Catching Exception::ERR_ITEM_NOT_FOUND in case sceneManager or entity was deleted since last rtt update. Forwarding other errors.
Definition SO3Entity.h:43
bool GetSceneNodeIsMouseForeground()
Definition SO3NodeScol.cpp:183
Ogre::SceneManager * GetOgreScenePointer()
Definition SO3Scene.cpp:449
~SSubEntitySelectorMaterialSwitcher()
Definition SO3SubEntitySelectorMaterialSwitcher.cpp:118
void ResetPriorizedObject()
Definition SO3SubEntitySelectorMaterialSwitcher.cpp:293
Ogre::SubEntity * GetSubEntity(const Ogre::ColourValue &searchedColour)
Definition SO3SubEntitySelectorMaterialSwitcher.cpp:320
virtual Ogre::Technique * handleSchemeNotFound(unsigned short schemeIndex, const Ogre::String &schemeName, Ogre::Material *originalMaterial, unsigned short lodIndex, const Ogre::Renderable *rend)
Definition SO3SubEntitySelectorMaterialSwitcher.cpp:131
void ResetSwitcher()
Definition SO3SubEntitySelectorMaterialSwitcher.cpp:285
Definition SO3Technique.h:42
Definition SO3DataScol.h:38
Generated by 1.9.8