| 536 | bool NoFogNeeded(float dist2, const Shape* shape, float bRadius); |
| 537 | |
| 538 | Ref<Shape> Object::PrepareShadow(int level, Vector3Par shadowPos, const FrameBase& frame) |
| 539 | { |
| 540 | Ref<Shape> ret; |
| 541 | // shadows can be less detailed than objects |
| 542 | PoseidonAssert(level >= 0); |
| 543 | |
| 544 | // prepare shadow for drawing |
| 545 | bool someAnim = IsAnimatedShadow(level); |
| 546 | if (someAnim || (!_static && !ShadowPoseFrozen())) |
| 547 | { |
| 548 | // do not cache shadows of dynamic objects |
| 549 | // if there is some animated texture |
| 550 | // it must be animated even in the shadow object |
| 551 | Animate(level); |
| 552 | // note: object may be destroyed |
| 553 | // in that case we need destroyed shadow? |
| 554 | ret = RecalcShadow(level, frame, true); |
| 555 | Deanimate(level); |
| 556 | } |
| 557 | else |
| 558 | { |
| 559 | if (!_static) |
| 560 | { |
| 561 | // frozen-pose dynamic caster actually routed through the cache |
| 562 | Poseidon::gShadowFrozenRouted++; |
| 563 | } |
| 564 | // if there exists pre-calculated shadow, use it |
| 565 | Matrix4 pos; |
| 566 | pos.SetOrientation(M3Identity); |
| 567 | pos.SetPosition(shadowPos); |
| 568 | ret = GScene->GetShadowCache().Shadow(this, GScene->MainLight()->ShadowDirection(), level, pos); |
| 569 | } |
| 570 | return ret; |
| 571 | } |
| 572 | |
| 573 | void Object::DrawShadow(Shape* shadow, Vector3Par shadowPos, ClipFlags clipFlags, const FrameBase& frame) |
| 574 | { |
no test coverage detected