DarkflameServer/dGame/dComponents/RigidbodyPhantomPhysicsComponent.cpp
David Markowitz 716a5fcf37 Rename some variables in Component
And add more virtuals
2023-06-06 18:59:53 -07:00

33 lines
927 B
C++

/*
* Darkflame Universe
* Copyright 2019
*/
#include "RigidbodyPhantomPhysicsComponent.h"
#include "Entity.h"
RigidbodyPhantomPhysicsComponent::RigidbodyPhantomPhysicsComponent(Entity* parent) : Component(parent) {
m_Position = m_OwningEntity->GetDefaultPosition();
m_Rotation = m_OwningEntity->GetDefaultRotation();
m_IsDirty = true;
}
RigidbodyPhantomPhysicsComponent::~RigidbodyPhantomPhysicsComponent() {
}
void RigidbodyPhantomPhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
outBitStream->Write(m_IsDirty || bIsInitialUpdate);
if (m_IsDirty || bIsInitialUpdate) {
outBitStream->Write(m_Position.x);
outBitStream->Write(m_Position.y);
outBitStream->Write(m_Position.z);
outBitStream->Write(m_Rotation.x);
outBitStream->Write(m_Rotation.y);
outBitStream->Write(m_Rotation.z);
outBitStream->Write(m_Rotation.w);
m_IsDirty = false;
}
}