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

Function SimplifyVertexSlow

Descent3/TerrainSearch.cpp:795–818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

793}
794
795int SimplifyVertexSlow(int x, int z, float delta) {
796 vector *eye = TS_View_position;
797 g3Point p1, p2;
798
799 p1.p3_codes = 0;
800 GetPreRotatedPoint(&p1, x, z, Terrain_seg[z * TERRAIN_WIDTH + x].ypos);
801
802 p2.p3_codes = 0;
803 GetSpecialRotatedPoint(&p2, x, z, Terrain_seg[z * TERRAIN_WIDTH + x].y + delta);
804
805 g3_ProjectPoint(&p1);
806 g3_ProjectPoint(&p2);
807
808 float len = ((p1.p3_sx - p2.p3_sx) * (p1.p3_sx - p2.p3_sx)) + ((p1.p3_sy - p2.p3_sy) * (p1.p3_sy - p2.p3_sy));
809
810#ifndef NEWEDITOR
811 if (len < (Detail_settings.Pixel_error * Detail_settings.Pixel_error))
812#else
813 if (len < (10.0f * 10.0f))
814#endif
815 return 1;
816
817 return 0;
818}
819
820int SimplifyVertex(int x, int z, float delta) {
821 vector *eye = TS_View_position;

Callers

nothing calls this directly

Calls 3

GetPreRotatedPointFunction · 0.85
GetSpecialRotatedPointFunction · 0.85
g3_ProjectPointFunction · 0.85

Tested by

no test coverage detected