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

Function GetPreRotatedPoint

Descent3/TerrainSearch.cpp:327–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327void GetPreRotatedPoint(g3Point *dest, int x, int z, int yvalue) {
328 ASSERT(yvalue >= 0 && yvalue <= 255);
329
330// If the terrain is supposed to be flat, bash this to zero
331#ifdef EDITOR
332 if (Flat_terrain) {
333 yvalue = 0;
334 }
335#endif
336
337 dest->p3_vec = TS_PreRows[z];
338 dest->p3_vec += TS_RVectorAdd * x;
339 dest->p3_vec += *GetDYVector(yvalue);
340
341 // also store the unrotated point
342 dest->p3_flags |= PF_ORIGPOINT;
343 dest->p3_vecPreRot.x = TERRAIN_SIZE * x;
344 dest->p3_vecPreRot.y = TERRAIN_HEIGHT_INCREMENT * yvalue;
345 dest->p3_vecPreRot.z = TERRAIN_SIZE * z;
346}
347
348// Gets a pre-rotated point that does not fall exactly on one of our 255 height values
349void GetSpecialRotatedPoint(g3Point *dest, int x, int z, float yvalue) {

Callers 3

DrawTerrainPointsFunction · 0.85
RotateTerrainListFunction · 0.85
SimplifyVertexSlowFunction · 0.85

Calls 1

GetDYVectorFunction · 0.85

Tested by

no test coverage detected