-----------------------------------------------------------------------------------
| 230 | } |
| 231 | //----------------------------------------------------------------------------------- |
| 232 | void HlmsLowLevel::executeCommand( const MovableObject *movableObject, Renderable *renderable, |
| 233 | bool casterPass ) |
| 234 | { |
| 235 | unsigned short numMatrices = 1; |
| 236 | if( renderable->getVaos( static_cast<VertexPass>( casterPass ) ).empty() ) |
| 237 | { |
| 238 | numMatrices = renderable->getNumWorldTransforms(); |
| 239 | renderable->getWorldTransforms( mTempXform ); |
| 240 | } |
| 241 | else |
| 242 | { |
| 243 | if( !renderable->hasSkeletonAnimation() ) |
| 244 | { |
| 245 | mTempXform[0] = movableObject->_getParentNodeFullTransform(); |
| 246 | } |
| 247 | else |
| 248 | { |
| 249 | SkeletonInstance *skeleton = movableObject->getSkeletonInstance(); |
| 250 | #if OGRE_DEBUG_MODE |
| 251 | assert( dynamic_cast<const RenderableAnimated *>( renderable ) ); |
| 252 | #endif |
| 253 | |
| 254 | const RenderableAnimated *renderableAnimated = |
| 255 | static_cast<const RenderableAnimated *>( renderable ); |
| 256 | |
| 257 | const RenderableAnimated::IndexMap *indexMap = |
| 258 | renderableAnimated->getBlendIndexToBoneIndexMap(); |
| 259 | |
| 260 | assert( indexMap->size() < 256 && |
| 261 | "Up to 256 bones per submesh are supported for low level materials!" ); |
| 262 | |
| 263 | RenderableAnimated::IndexMap::const_iterator itBone = indexMap->begin(); |
| 264 | RenderableAnimated::IndexMap::const_iterator enBone = indexMap->end(); |
| 265 | |
| 266 | size_t matIdx = 0; |
| 267 | while( itBone != enBone ) |
| 268 | { |
| 269 | const SimpleMatrixAf4x3 &mat4x3 = skeleton->_getBoneFullTransform( *itBone ); |
| 270 | mat4x3.store( &mTempXform[matIdx++] ); |
| 271 | |
| 272 | ++itBone; |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | const MaterialPtr &mat = renderable->getMaterial(); |
| 278 | Technique *technique = mat->getBestTechnique( renderable->getCurrentMaterialLod(), renderable ); |
| 279 | const Pass *pass = technique->getPass( 0 ); |
| 280 | |
| 281 | mAutoParamDataSource->setCurrentRenderable( renderable ); |
| 282 | mAutoParamDataSource->setWorldMatrices( mTempXform, numMatrices ); |
| 283 | mAutoParamDataSource->setCurrentPass( pass ); |
| 284 | mAutoParamDataSource->setCurrentLightList( &renderable->getLights() ); |
| 285 | |
| 286 | #if OGRE_COMPILER == OGRE_COMPILER_MSVC |
| 287 | # pragma warning( push, 0 ) |
| 288 | #else |
| 289 | # pragma GCC diagnostic push |
no test coverage detected