DarkflameServer/dGame/dComponents/ModelComponent.cpp
Aaron Kimbrell e524b86e12
breakout the component types into a scoped enum (#1002)
* breakout the component types into a scoped enum

tested that things are the same as they were before

* fix missed rename

* fix brick-by-brick name to be crafting
because that's what it is
2023-03-04 01:16:37 -06:00

24 lines
772 B
C++

#include "ModelComponent.h"
#include "Entity.h"
#include "ePhysicsBehaviorType.h"
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;
}
}