Cleaning up NetworkTime and reworking how we approach network interpolation

Signed-off-by: puvvadar <puvvadar@amazon.com>
This commit is contained in:
puvvadar
2021-09-02 14:24:46 -07:00
parent de512db010
commit c5d8c194df
9 changed files with 66 additions and 102 deletions
@@ -35,7 +35,7 @@ namespace Multiplayer
using EntityMigrationStartEvent = AZ::Event<ClientInputId>;
using EntityMigrationEndEvent = AZ::Event<>;
using EntityServerMigrationEvent = AZ::Event<const ConstNetworkEntityHandle&, HostId, AzNetworking::ConnectionId>;
using EntityPreRenderEvent = AZ::Event<float, float>;
using EntityPreRenderEvent = AZ::Event<float>;
using EntityCorrectionEvent = AZ::Event<>;
//! @class NetBindComponent
@@ -118,7 +118,7 @@ namespace Multiplayer
void NotifyMigrationStart(ClientInputId migratedInputId);
void NotifyMigrationEnd();
void NotifyServerMigration(HostId hostId, AzNetworking::ConnectionId connectionId);
void NotifyPreRender(float deltaTime, float blendFactor);
void NotifyPreRender(float deltaTime);
void NotifyCorrection();
void AddEntityStopEventHandler(EntityStopEvent::Handler& eventHandler);
@@ -29,24 +29,9 @@ namespace Multiplayer
void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
private:
void OnPreRender(float deltaTime, float blendFactor);
void OnPreRender(float deltaTime);
void OnCorrection();
void OnRotationChangedEvent(const AZ::Quaternion& rotation);
void OnTranslationChangedEvent(const AZ::Vector3& translation);
void OnScaleChangedEvent(float scale);
void OnResetCountChangedEvent();
void UpdateTargetHostFrameId();
AZ::Transform m_previousTransform = AZ::Transform::CreateIdentity();
AZ::Transform m_targetTransform = AZ::Transform::CreateIdentity();
AZ::Event<AZ::Quaternion>::Handler m_rotationEventHandler;
AZ::Event<AZ::Vector3>::Handler m_translationEventHandler;
AZ::Event<float>::Handler m_scaleEventHandler;
AZ::Event<uint8_t>::Handler m_resetCountEventHandler;
EntityPreRenderEvent::Handler m_entityPreRenderEventHandler;
EntityCorrectionEvent::Handler m_entityCorrectionEventHandler;