2024-05-10 14:22:26 +00:00
|
|
|
// Darkflame Universe
|
|
|
|
// Copyright 2024
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-05-10 14:22:26 +00:00
|
|
|
#ifndef RIGIDBODYPHANTOMPHYSICS_H
|
|
|
|
#define RIGIDBODYPHANTOMPHYSICS_H
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
#include "BitStream.h"
|
|
|
|
#include "dCommonVars.h"
|
|
|
|
#include "NiPoint3.h"
|
|
|
|
#include "NiQuaternion.h"
|
2023-10-09 20:19:38 +00:00
|
|
|
#include "PhysicsComponent.h"
|
2023-03-04 07:16:37 +00:00
|
|
|
#include "eReplicaComponentType.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-05-10 14:22:26 +00:00
|
|
|
class dpEntity;
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
/**
|
|
|
|
* Component that handles rigid bodies that can be interacted with, mostly client-side rendered. An example is the
|
|
|
|
* bananas that fall from trees in GF.
|
|
|
|
*/
|
2023-10-09 20:19:38 +00:00
|
|
|
class RigidbodyPhantomPhysicsComponent : public PhysicsComponent {
|
2021-12-05 17:54:36 +00:00
|
|
|
public:
|
2024-01-24 05:13:23 +00:00
|
|
|
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::RIGID_BODY_PHANTOM_PHYSICS;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2024-12-16 05:44:57 +00:00
|
|
|
RigidbodyPhantomPhysicsComponent(Entity* parent, int32_t componentId);
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2024-05-10 14:22:26 +00:00
|
|
|
void Update(const float deltaTime) override;
|
|
|
|
|
2024-02-27 07:25:44 +00:00
|
|
|
void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override;
|
2024-05-10 14:22:26 +00:00
|
|
|
|
|
|
|
void SpawnVertices() const;
|
|
|
|
private:
|
|
|
|
float m_Scale{};
|
|
|
|
|
|
|
|
dpEntity* m_dpEntity{};
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|
|
|
|
|
2024-05-10 14:22:26 +00:00
|
|
|
#endif // RIGIDBODYPHANTOMPHYSICS_H
|