MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / backSyncCamera

Method backSyncCamera

plugins/dm.gameconnection/GameConnection.cpp:570–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570void GameConnection::backSyncCamera()
571{
572 try {
573 _engine->waitForTags();
574 std::string text = executeGenericRequest(composeConExecRequest("getviewpos"));
575
576 Vector3 orig, angles;
577 if (sscanf(text.c_str(), "%lf%lf%lf%lf%lf%lf", &orig.x(), &orig.y(), &orig.z(), &angles.x(), &angles.y(), &angles.z()) == 6) {
578 try {
579 auto& camera = GlobalCameraManager().getActiveView();
580 angles.x() *= -1.0;
581 camera.setOriginAndAngles(orig, angles);
582 }
583 catch (const std::runtime_error&) {
584 // no camera view
585 }
586 }
587 }
588 catch (const DisconnectException&) {
589 //disconnected: will be handled during next think
590 return;
591 }
592}
593
594void GameConnection::togglePauseGame()
595{

Callers 1

GameConnectionPanelMethod · 0.80

Calls 7

waitForTagsMethod · 0.80
xMethod · 0.80
yMethod · 0.80
zMethod · 0.80
getActiveViewMethod · 0.80
c_strMethod · 0.45
setOriginAndAnglesMethod · 0.45

Tested by

no test coverage detected