MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ComputeTerrainSpeedTable

Function ComputeTerrainSpeedTable

editor/editor_lighting.cpp:1793–1814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1791}
1792
1793void ComputeTerrainSpeedTable() {
1794 int i, t, j, raynum = 0;
1795
1796 mprintf(0, "Precomputing terrain speed table...(%d rays)\n", AREA_X * AREA_Z);
1797 for (i = 0; i < AREA_Z; i++) {
1798 for (t = 0; t < AREA_X; t++) {
1799 int tseg = i * TERRAIN_WIDTH + t;
1800 vector pos;
1801
1802 pos.x = (t * TERRAIN_SIZE);
1803 pos.z = (i * TERRAIN_SIZE);
1804 pos.y = (Terrain_seg[tseg].y) + .001;
1805
1806 raynum++;
1807 if ((raynum % 1000) == 0)
1808 mprintf_at(2, 4, 0, "Ray=%d ", raynum);
1809
1810 for (j = 0; j < Terrain_sky.num_satellites; j++)
1811 TerrainLightSpeedup[j][tseg] = ShootRayForTerrainLight(&pos, &Terrain_sky.satellite_vectors[j], tseg);
1812 }
1813 }
1814}
1815
1816float GetMaxColor(spectra *sp);
1817

Callers 1

DoRadiosityForTerrainFunction · 0.85

Calls 1

ShootRayForTerrainLightFunction · 0.85

Tested by

no test coverage detected