2023-06-08 15:29:17 +00:00
|
|
|
#include "ModelBehaviorComponent.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
#include "Entity.h"
|
2023-02-11 03:33:30 +00:00
|
|
|
#include "ePhysicsBehaviorType.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-06-08 15:29:17 +00:00
|
|
|
ModelBehaviorComponent::ModelBehaviorComponent(Entity* parent) : Component(parent) {
|
2023-02-11 03:33:30 +00:00
|
|
|
m_DirtyModelInfo = false;
|
|
|
|
m_IsPickable = false;
|
|
|
|
m_PhysicsType = ePhysicsBehaviorType::STANDARD;
|
2023-06-09 09:46:01 +00:00
|
|
|
m_OriginalPosition = m_ParentEntity->GetDefaultPosition();
|
|
|
|
m_OriginalRotation = m_ParentEntity->GetDefaultRotation();
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2023-06-08 15:29:17 +00:00
|
|
|
void ModelBehaviorComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
|
2023-02-11 03:33:30 +00:00
|
|
|
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-19 21:51:35 +00:00
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
2023-02-11 03:33:30 +00:00
|
|
|
|