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

Method SystemClientShip

source/game/StarSystemWorld.cpp:491–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489}
490
491SystemClientShip::SystemClientShip(SystemWorld* system, Uuid uuid, float speed, SystemLocation const& location)
492 : m_uuid(std::move(uuid)) {
493 m_systemLocation.set(location);
494 setPosition(system->systemLocationPosition(location).value({}));
495
496 // temporary
497 auto shipConfig = Root::singleton().assets()->json("/systemworld.config:clientShip");
498 m_config = ClientShipConfig{
499 shipConfig.getFloat("orbitDistance"),
500 shipConfig.getFloat("departTime"),
501 shipConfig.getFloat("spaceDepartTime")
502 };
503 m_speed = speed;
504 m_departTimer = 0.0f;
505
506 // systemLocation should not be interpolated
507 // if it's stale it can point to a removed system object
508 m_netGroup.addNetElement(&m_systemLocation, false);
509 m_netGroup.addNetElement(&m_destination);
510
511 m_netGroup.addNetElement(&m_xPosition);
512 m_netGroup.addNetElement(&m_yPosition);
513 m_netGroup.enableNetInterpolation();
514
515 m_xPosition.setInterpolator(lerp<float, float>);
516 m_yPosition.setInterpolator(lerp<float, float>);
517}
518
519SystemClientShip::SystemClientShip(SystemWorld* system, Uuid uuid, SystemLocation const& location)
520 : SystemClientShip(system, uuid, 0.0f, location) {}

Callers

nothing calls this directly

Calls 10

singletonClass · 0.85
jsonMethod · 0.80
assetsMethod · 0.80
getFloatMethod · 0.80
setInterpolatorMethod · 0.80
setMethod · 0.45
valueMethod · 0.45
addNetElementMethod · 0.45

Tested by

no test coverage detected