This commit is contained in:
David Markowitz
2023-08-09 00:34:39 -07:00
parent fc56777969
commit 5f7a108154
5 changed files with 41 additions and 14 deletions

View File

@@ -71,7 +71,10 @@ ControllablePhysicsComponent::~ControllablePhysicsComponent() {
}
void ControllablePhysicsComponent::Update(float deltaTime) {
if (m_Velocity == NiPoint3::ZERO) return;
m_Position += m_Velocity * deltaTime;
m_DirtyPosition = true;
Game::entityManager->SerializeEntity(m_Parent);
}
void ControllablePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
@@ -153,6 +156,7 @@ void ControllablePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bo
}
outBitStream->Write0();
if (!bIsInitialUpdate) m_DirtyPosition = false;
}
if (!bIsInitialUpdate) {