----------------------------------------------------------------------------- Object Rendering -----------------------------------------------------------------------------
| 182 | // Object Rendering |
| 183 | //----------------------------------------------------------------------------- |
| 184 | void RenderShapeExample::createShape() |
| 185 | { |
| 186 | if ( getShape() == StringTable->EmptyString() ) |
| 187 | return; |
| 188 | |
| 189 | // If this is the same shape then no reason to update it |
| 190 | if ( mShapeInstance && getShape() == StringTable->insert(mShape.getPath().getFullPath().c_str()) ) |
| 191 | return; |
| 192 | |
| 193 | // Clean up our previous shape |
| 194 | if ( mShapeInstance ) |
| 195 | SAFE_DELETE( mShapeInstance ); |
| 196 | |
| 197 | // Attempt to preload the Materials for this shape |
| 198 | if ( isClientObject() && |
| 199 | !mShape->preloadMaterialList( mShape.getPath() ) && |
| 200 | NetConnection::filesWereDownloaded() ) |
| 201 | { |
| 202 | return; |
| 203 | } |
| 204 | |
| 205 | // Update the bounding box |
| 206 | mObjBox = mShape->mBounds; |
| 207 | resetWorldBox(); |
| 208 | setRenderTransform(mObjToWorld); |
| 209 | |
| 210 | // Create the TSShapeInstance |
| 211 | mShapeInstance = new TSShapeInstance( mShape, isClientObject() ); |
| 212 | } |
| 213 | |
| 214 | void RenderShapeExample::prepRenderImage( SceneRenderState *state ) |
| 215 | { |
nothing calls this directly
no test coverage detected