| 2037 | // be from cache itself plus any holdouts on the entity side). |
| 2038 | Shapes.ForEach([](LODShapeWithShadow& shape) |
| 2039 | { Log("Shape %s not released (%d refs).", shape.Name(), shape.RefCounter()); }); |
| 2040 | Shapes.Clear(); |
| 2041 | |
| 2042 | MagazineTypes.Clear(); |
| 2043 | WeaponTypes.Clear(); |
| 2044 | } |
| 2045 | |
| 2046 | bool Scene::ShadowPos(Vector3Par pos, Vector3& aprox, LightSun* light) |
| 2047 | { // |
| 2048 | Vector3Val dir = light->ShadowDirection(); |
| 2049 | if (dir.Y() > 0) |
| 2050 | { |
| 2051 | return false; // shadow casted up - no real shadow |
| 2052 | } |
| 2053 | const float maxShadow = 300; |
| 2054 | float t = GetLandscape()->IntersectWithGround(&aprox, pos, dir, 0, maxShadow * 1.1); |
| 2055 | if (t > maxShadow) |
| 2056 | { |
| 2057 | // no intersection |
| 2058 | return false; |
| 2059 | } |
| 2060 | if (t <= 0.01f) |
| 2061 | { |
| 2062 | // up -> on surface required |
no test coverage detected