Update ControllablePhysicsComponent.cpp

This commit is contained in:
David Markowitz 2024-03-10 01:51:10 -08:00
parent cf8332d3fd
commit 0f6b47a833

View File

@ -65,9 +65,7 @@ ControllablePhysicsComponent::~ControllablePhysicsComponent() {
} }
void ControllablePhysicsComponent::Update(float deltaTime) { void ControllablePhysicsComponent::Update(float deltaTime) {
if (m_Velocity == NiPoint3Constant::ZERO) return;
SetPosition(m_Position + (m_Velocity * deltaTime));
Game::entityManager->SerializeEntity(m_Parent);
} }
void ControllablePhysicsComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) { void ControllablePhysicsComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) {
@ -243,7 +241,6 @@ void ControllablePhysicsComponent::SetIsOnRail(bool val) {
void ControllablePhysicsComponent::SetDirtyPosition(bool val) { void ControllablePhysicsComponent::SetDirtyPosition(bool val) {
m_DirtyPosition = val; m_DirtyPosition = val;
} }
void ControllablePhysicsComponent::AddPickupRadiusScale(float value) { void ControllablePhysicsComponent::AddPickupRadiusScale(float value) {
m_ActivePickupRadiusScales.push_back(value); m_ActivePickupRadiusScales.push_back(value);
if (value > m_PickupRadius) { if (value > m_PickupRadius) {