| 489 | } |
| 490 | |
| 491 | SystemClientShip::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 | |
| 519 | SystemClientShip::SystemClientShip(SystemWorld* system, Uuid uuid, SystemLocation const& location) |
| 520 | : SystemClientShip(system, uuid, 0.0f, location) {} |
nothing calls this directly
no test coverage detected