MCPcopy Create free account
hub / github.com/ddnet/ddnet / SetView

Method SetView

src/game/client/components/camera.cpp:501–511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499}
500
501void CCamera::SetView(ivec2 Pos, bool Relative)
502{
503 vec2 RealPos = vec2(Pos.x * 32.0, Pos.y * 32.0);
504 vec2 UntestedViewPos = Relative ? m_ForceFreeviewPos + RealPos : RealPos;
505
506 m_ForceFreeview = true;
507
508 m_ForceFreeviewPos = vec2(
509 std::clamp(UntestedViewPos.x, 200.0f, Collision()->GetWidth() * 32 - 200.0f),
510 std::clamp(UntestedViewPos.y, 200.0f, Collision()->GetHeight() * 32 - 200.0f));
511}
512
513void CCamera::GotoSwitch(int Number, int Offset)
514{

Callers 2

ConSetViewMethod · 0.80
ConSetViewRelativeMethod · 0.80

Calls 2

GetWidthMethod · 0.80
GetHeightMethod · 0.80

Tested by

no test coverage detected