2021-12-05 17:54:36 +00:00
|
|
|
/*
|
|
|
|
* Darkflame Universe
|
|
|
|
* Copyright 2019
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "RigidbodyPhantomPhysicsComponent.h"
|
|
|
|
#include "Entity.h"
|
|
|
|
|
|
|
|
RigidbodyPhantomPhysicsComponent::RigidbodyPhantomPhysicsComponent(Entity* parent) : Component(parent) {
|
2023-06-07 01:59:53 +00:00
|
|
|
m_Position = m_OwningEntity->GetDefaultPosition();
|
|
|
|
m_Rotation = m_OwningEntity->GetDefaultRotation();
|
2022-07-28 13:39:57 +00:00
|
|
|
m_IsDirty = true;
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RigidbodyPhantomPhysicsComponent::~RigidbodyPhantomPhysicsComponent() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void RigidbodyPhantomPhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
|
2022-07-28 13:39:57 +00:00
|
|
|
outBitStream->Write(m_IsDirty || bIsInitialUpdate);
|
|
|
|
if (m_IsDirty || bIsInitialUpdate) {
|
|
|
|
outBitStream->Write(m_Position.x);
|
|
|
|
outBitStream->Write(m_Position.y);
|
|
|
|
outBitStream->Write(m_Position.z);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
outBitStream->Write(m_Rotation.x);
|
|
|
|
outBitStream->Write(m_Rotation.y);
|
|
|
|
outBitStream->Write(m_Rotation.z);
|
|
|
|
outBitStream->Write(m_Rotation.w);
|
|
|
|
|
|
|
|
m_IsDirty = false;
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|