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

Function TCAMCenterOnPlayer

Descent3/TelComAutoMap.cpp:246–261  ·  view source on GitHub ↗

Returns the camera position to the player

Source from the content-addressed store, hash-verified

244
245// Returns the camera position to the player
246void TCAMCenterOnPlayer() {
247
248 vm_MakeZero(&AM_view_pos);
249 vm_MakeIdentity(&AM_view_orient);
250
251 matrix newmat;
252 angvec heading;
253 AM_view_pos = Viewer_object->pos - (Viewer_object->orient.fvec * 10);
254 vm_ExtractAnglesFromMatrix(&heading, &Player_object->orient);
255
256 vm_AnglesToMatrix(&newmat, 0, heading.h, 0);
257 AM_view_orient = newmat;
258
259 AM_heading = heading.h;
260 AM_pitch = heading.p;
261}
262
263// This is the function called by TelCom
264// return true if TelCom should exit to TelCom Main Menu

Callers 2

TelComAutoMapFunction · 0.85
TCAMCallbackFunction · 0.85

Calls 4

vm_MakeZeroFunction · 0.85
vm_MakeIdentityFunction · 0.50
vm_AnglesToMatrixFunction · 0.50

Tested by

no test coverage detected