| 189 | } |
| 190 | |
| 191 | void SkySphere::_renderObject(ObjectRenderInst* ri, SceneRenderState* state, BaseMatInstance* mi) |
| 192 | { |
| 193 | GFXDEBUGEVENT_SCOPE(SkySphere_RenderObject, ColorI::WHITE); |
| 194 | |
| 195 | GFXTransformSaver saver; |
| 196 | GFX->setVertexBuffer(mVB); |
| 197 | |
| 198 | MatrixF worldMat = MatrixF::Identity; |
| 199 | worldMat.setPosition(Point3F( |
| 200 | state->getCameraPosition().x, |
| 201 | state->getCameraPosition().y, |
| 202 | state->getCameraPosition().z)); |
| 203 | |
| 204 | SceneData sgData; |
| 205 | sgData.init(state); |
| 206 | sgData.objTrans = &worldMat; |
| 207 | |
| 208 | mMatrixSet->restoreSceneViewProjection(); |
| 209 | mMatrixSet->setWorld(worldMat); |
| 210 | if (state->isReflectPass()) |
| 211 | mMatrixSet->setProjection(state->getSceneManager()->getNonClipProjection()); |
| 212 | |
| 213 | while (mMatInstance->setupPass(state, sgData)) |
| 214 | { |
| 215 | mMatInstance->setTransforms(*mMatrixSet, state); |
| 216 | mMatInstance->setSceneInfo(state, sgData); |
| 217 | |
| 218 | GFX->drawPrimitive(GFXTriangleList, 0, mPrimCount); |
| 219 | } |
| 220 | |
| 221 | // Draw render band. |
| 222 | if (mFogBandHeight > 0 && mFogBandMatInst) |
| 223 | { |
| 224 | const FogData& fog = state->getSceneManager()->getFogData(); |
| 225 | if (mLastFogColor != fog.color) |
| 226 | { |
| 227 | mLastFogColor = fog.color; |
| 228 | _initRender(); |
| 229 | } |
| 230 | |
| 231 | // Just need it to follow the camera... no rotation. |
| 232 | MatrixF camPosMat(MatrixF::Identity); |
| 233 | camPosMat.setPosition(worldMat.getPosition()); |
| 234 | sgData.objTrans = &camPosMat; |
| 235 | mMatrixSet->setWorld(*sgData.objTrans); |
| 236 | |
| 237 | while (mFogBandMatInst->setupPass(state, sgData)) |
| 238 | { |
| 239 | mFogBandMatInst->setTransforms(*mMatrixSet, state); |
| 240 | mFogBandMatInst->setSceneInfo(state, sgData); |
| 241 | |
| 242 | GFX->setVertexBuffer(mFogBandVB); |
| 243 | GFX->drawPrimitive(GFXTriangleList, 0, mFogPrimCount); |
| 244 | } |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | void SkySphere::clearVectors() |
nothing calls this directly
no test coverage detected