| 124 | } |
| 125 | |
| 126 | bool ProjectedShadow::shouldRender( const SceneRenderState *state ) |
| 127 | { |
| 128 | // Don't render if our object has been removed from the |
| 129 | // scene graph. |
| 130 | |
| 131 | if( !mParentObject->getSceneManager() ) |
| 132 | return false; |
| 133 | |
| 134 | // Don't render if the ShapeBase |
| 135 | // object's fade value is greater |
| 136 | // than the visibility epsilon. |
| 137 | bool shapeFade = mShapeBase && mShapeBase->getFadeVal() < TSMesh::VISIBILITY_EPSILON; |
| 138 | |
| 139 | // Get the shapebase datablock if we have one. |
| 140 | ShapeBaseData *data = NULL; |
| 141 | if ( mShapeBase ) |
| 142 | data = static_cast<ShapeBaseData*>( mShapeBase->getDataBlock() ); |
| 143 | |
| 144 | // Also don't render if |
| 145 | // the camera distance is greater |
| 146 | // than the shadow length. |
| 147 | if ( shapeFade || !mDecalData || |
| 148 | ( mDecalInstance && |
| 149 | mDecalInstance->calcPixelSize( state->getViewport().extent.y, state->getCameraPosition(), state->getWorldToScreenScale().y ) < mDecalInstance->mDataBlock->fadeEndPixelSize ) ) |
| 150 | { |
| 151 | // Release our shadow texture |
| 152 | // so that others can grab it out |
| 153 | // of the pool. |
| 154 | mShadowTexture = NULL; |
| 155 | |
| 156 | return false; |
| 157 | } |
| 158 | |
| 159 | return true; |
| 160 | } |
| 161 | |
| 162 | bool ProjectedShadow::_updateDecal( const SceneRenderState *state ) |
| 163 | { |
nothing calls this directly
no test coverage detected