DarkflameServer/dGame/dComponents/ModelComponent.cpp

24 lines
772 B
C++
Raw Permalink Normal View History

#include "ModelComponent.h"
#include "Entity.h"
#include "ePhysicsBehaviorType.h"
2022-07-28 13:39:57 +00:00
ModelComponent::ModelComponent(Entity* parent) : Component(parent) {
m_DirtyModelInfo = false;
m_IsPickable = false;
m_PhysicsType = ePhysicsBehaviorType::STANDARD;
m_OriginalPosition = m_Parent->GetDefaultPosition();
m_OriginalRotation = m_Parent->GetDefaultRotation();
}
void ModelComponent::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);
m_DirtyModelInfo = false;
2022-07-28 13:39:57 +00:00
}
}