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