mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
chore: Change entity and component logic to use bitstream references (#1468)
* chore: Change entity and component logic to use bitstream references * merge
This commit is contained in:
@@ -6,16 +6,16 @@ PhysicsComponent::PhysicsComponent(Entity* parent) : Component(parent) {
|
||||
m_DirtyPosition = false;
|
||||
}
|
||||
|
||||
void PhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate) {
|
||||
outBitStream->Write(bIsInitialUpdate || m_DirtyPosition);
|
||||
void PhysicsComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) {
|
||||
outBitStream.Write(bIsInitialUpdate || m_DirtyPosition);
|
||||
if (bIsInitialUpdate || m_DirtyPosition) {
|
||||
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);
|
||||
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);
|
||||
if (!bIsInitialUpdate) m_DirtyPosition = false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user