MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / ShakeCameraViewNear

Method ShakeCameraViewNear

Sources/Jazz2/LevelHandler.cpp:2006–2019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2004 }
2005
2006 void LevelHandler::ShakeCameraViewNear(Vector2f pos, float duration)
2007 {
2008 constexpr float MaxDistance = 800.0f;
2009
2010 for (auto& viewport : _assignedViewports) {
2011 if ((viewport->_targetActor->_pos - pos).Length() <= MaxDistance) {
2012 viewport->ShakeCameraView(duration);
2013
2014 if (auto* player = runtime_cast<Actors::Player>(viewport->_targetActor)) {
2015 PlayerExecuteRumble(player, "Shake"_s);
2016 }
2017 }
2018 }
2019 }
2020
2021 bool LevelHandler::GetTrigger(std::uint8_t triggerId)
2022 {

Callers 2

OnTriggeredEventMethod · 0.80
OnUpdateMethod · 0.80

Calls 2

LengthMethod · 0.45
ShakeCameraViewMethod · 0.45

Tested by

no test coverage detected