mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-24 22:47:25 +00:00
b261e63233
* chore: Change entity and component logic to use bitstream references * merge
33 lines
889 B
C++
33 lines
889 B
C++
#ifndef __PHYSICSCOMPONENT__H__
|
|
#define __PHYSICSCOMPONENT__H__
|
|
|
|
#include "Component.h"
|
|
#include "NiPoint3.h"
|
|
#include "NiQuaternion.h"
|
|
|
|
namespace Raknet {
|
|
class BitStream;
|
|
};
|
|
|
|
class PhysicsComponent : public Component {
|
|
public:
|
|
PhysicsComponent(Entity* parent);
|
|
virtual ~PhysicsComponent() = default;
|
|
|
|
void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override;
|
|
|
|
const NiPoint3& GetPosition() const { return m_Position; }
|
|
virtual void SetPosition(const NiPoint3& pos) { if (m_Position == pos) return; m_Position = pos; m_DirtyPosition = true; }
|
|
|
|
const NiQuaternion& GetRotation() const { return m_Rotation; }
|
|
virtual void SetRotation(const NiQuaternion& rot) { if (m_Rotation == rot) return; m_Rotation = rot; m_DirtyPosition = true; }
|
|
protected:
|
|
NiPoint3 m_Position;
|
|
|
|
NiQuaternion m_Rotation;
|
|
|
|
bool m_DirtyPosition;
|
|
};
|
|
|
|
#endif //!__PHYSICSCOMPONENT__H__
|