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

Method MoveSat

editor/TerrainDialog.cpp:1368–1383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1366}
1367
1368void CTerrainDialog::MoveSat(int pitch, int heading) {
1369 int n = Current_satellite;
1370 matrix rot_matrix, orient;
1371 vm_AnglesToMatrix(&rot_matrix, pitch, heading, 0); // move up a little
1372
1373 orient = rot_matrix;
1374
1375 vector sat_vec = Terrain_sky.satellite_vectors[n] - Viewer_object->pos;
1376 float mag = vm_GetMagnitude(&sat_vec);
1377 vector rot_vec;
1378
1379 vm_NormalizeVector(&sat_vec);
1380 vm_MatrixMulVector(&rot_vec, &sat_vec, &orient);
1381
1382 Terrain_sky.satellite_vectors[n] = Viewer_object->pos + (rot_vec * mag);
1383}
1384
1385void CTerrainDialog::OnMoveSatUp() {
1386 MoveSat(1500, 0);

Callers

nothing calls this directly

Calls 4

vm_NormalizeVectorFunction · 0.85
vm_AnglesToMatrixFunction · 0.50
vm_GetMagnitudeFunction · 0.50
vm_MatrixMulVectorFunction · 0.50

Tested by

no test coverage detected