MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / cameraPosition

Method cameraPosition

source/game/StarPlayer.cpp:2684–2701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2682}
2683
2684Vec2F Player::cameraPosition() {
2685 if (inWorld()) {
2686 if (auto loungeAnchor = as<LoungeAnchor>(m_movementController->entityAnchor())) {
2687 if (loungeAnchor->cameraFocus) {
2688 if (auto anchoredEntity = world()->entity(m_movementController->anchorState()->entityId))
2689 return anchoredEntity->position();
2690 }
2691 }
2692
2693 if (m_cameraFocusEntity) {
2694 if (auto focusedEntity = world()->entity(*m_cameraFocusEntity))
2695 return focusedEntity->position();
2696 else
2697 m_cameraFocusEntity = {};
2698 }
2699 }
2700 return position();
2701}
2702
2703NetworkedAnimatorPtr Player::effectsAnimator() {
2704 return m_effectsAnimator;

Callers 1

updateCameraMethod · 0.80

Calls 4

entityAnchorMethod · 0.80
anchorStateMethod · 0.80
entityMethod · 0.45
positionMethod · 0.45

Tested by

no test coverage detected