| 326 | } |
| 327 | |
| 328 | void SceneObject::updateData() |
| 329 | { |
| 330 | clear(); |
| 331 | |
| 332 | Ogre::Entity* entity = getSceneManager()->getEntity(mEntityName); |
| 333 | if (entity != nullptr && !mMaterialName.empty()) |
| 334 | { |
| 335 | mVertexCount = 0; |
| 336 | mIndexCount = 0; |
| 337 | GetMeshInformation( |
| 338 | entity->getMesh(), |
| 339 | mVertexCount, |
| 340 | mVertices, |
| 341 | mIndexCount, |
| 342 | mIndices, |
| 343 | mTextureCoords, |
| 344 | Ogre::Vector3::ZERO, |
| 345 | Ogre::Quaternion::IDENTITY, |
| 346 | Ogre::Vector3::UNIT_SCALE, |
| 347 | mMaterialName); |
| 348 | |
| 349 | Ogre::MaterialPtr material = (Ogre::MaterialPtr)Ogre::MaterialManager::getSingleton().getByName( |
| 350 | mMaterialName, |
| 351 | base::BaseManager::MyGuiResourceGroup); |
| 352 | if (material) |
| 353 | { |
| 354 | mTextureUnit = material->getTechnique(0)->getPass(0)->getTextureUnitState("gui"); |
| 355 | if (mTextureUnit) |
| 356 | { |
| 357 | mTextureUnit->setTextureName(mTextureName); |
| 358 | mUScale = mTextureUnit->getTextureUScale(); |
| 359 | mVScale = mTextureUnit->getTextureVScale(); |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | void SceneObject::setTextureName(std::string_view _name) |
| 366 | { |
nothing calls this directly
no test coverage detected