DarkflameServer/dGame/dComponents/ModelBehaviorComponent.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
838 B
C++
Raw Normal View History

#include "ModelBehaviorComponent.h"
#include "Entity.h"
#include "ePhysicsBehaviorType.h"
ModelBehaviorComponent::ModelBehaviorComponent(Entity* parent) : Component(parent) {
2023-07-06 03:37:16 +00:00
m_DirtyModelInfo = true;
m_IsPickable = false;
m_PhysicsType = ePhysicsBehaviorType::STANDARD;
m_OriginalPosition = m_ParentEntity->GetDefaultPosition();
m_OriginalRotation = m_ParentEntity->GetDefaultRotation();
}
void ModelBehaviorComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
outBitStream->Write(m_DirtyModelInfo || bIsInitialUpdate);
if (m_DirtyModelInfo || bIsInitialUpdate) {
outBitStream->Write(m_IsPickable);
outBitStream->Write(m_PhysicsType);
outBitStream->Write(m_OriginalPosition);
outBitStream->Write(m_OriginalRotation);
2023-07-06 03:37:16 +00:00
if (!bIsInitialUpdate) m_DirtyModelInfo = false;
}
}