mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-25 23:13:35 +00:00
a0d51e21ca
* allow usage of NiPoint3 and NiQuaternion in constexpr context * removed .cpp files entirely * moving circular dependency circumvention stuff to an .inl file * real world usage!!!!! * reverting weird branch cross-pollination * removing more weird branch cross-pollination * remove comment * added inverse header guard to inl file * Update NiPoint3.inl * trying different constructor syntax * reorganize into .inl files for readability * uncomment include * moved non-constexpr definitions to cpp file * moved static definitions back to inl files * testing fix * moved constants into seperate namespace * Undo change in build-and-test.yml * nodiscard
22 lines
725 B
C++
22 lines
725 B
C++
#include "PhysicsComponent.h"
|
|
|
|
PhysicsComponent::PhysicsComponent(Entity* parent) : Component(parent) {
|
|
m_Position = NiPoint3Constant::ZERO;
|
|
m_Rotation = NiQuaternionConstant::IDENTITY;
|
|
m_DirtyPosition = false;
|
|
}
|
|
|
|
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);
|
|
if (!bIsInitialUpdate) m_DirtyPosition = false;
|
|
}
|
|
}
|