Files
DarkflameServer/dGame/dComponents/RigidbodyPhantomPhysicsComponent.h
Aaron Kimbrell 43b99b730f refactor(component): physics components load in the client's phases
The physics row's collision group in LoadDataFromTemplate and the level's
CollisionGroupID in LoadConfigData; each physics type then reads its own level
keys and makes its physics after that, in the same order as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 08:34:28 -05:00

42 lines
1.1 KiB
C++

// Darkflame Universe
// Copyright 2024
#ifndef RIGIDBODYPHANTOMPHYSICS_H
#define RIGIDBODYPHANTOMPHYSICS_H
#include "BitStream.h"
#include "dCommonVars.h"
#include "NiPoint3.h"
#include "NiQuaternion.h"
#include "PhysicsComponent.h"
#include "eReplicaComponentType.h"
class dpEntity;
/**
* 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.
*/
class RigidbodyPhantomPhysicsComponent : public PhysicsComponent {
public:
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::RIGID_BODY_PHANTOM_PHYSICS;
RigidbodyPhantomPhysicsComponent(Entity* parent, const int32_t componentID);
void LoadConfigData() override;
void Run(const float deltaTime) override;
void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override;
void SpawnVertices() const;
private:
bool OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo);
float m_Scale{};
dpEntity* m_dpEntity{};
};
#endif // RIGIDBODYPHANTOMPHYSICS_H