From a9c4a2fe26b539e65291989970434c589d34392e Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Thu, 1 Oct 2026 06:43:53 -0500 Subject: [PATCH] feat(entity): the client's culling plane component (116) Co-Authored-By: Claude Opus 5.5 --- dGame/Entity.cpp | 7 +++++++ dGame/dComponents/CullingPlaneComponent.h | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 dGame/dComponents/CullingPlaneComponent.h diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 7e4bc5a71..b9eb8ab29 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -90,6 +90,7 @@ #include "CollectibleComponent.h" #include "ItemComponent.h" #include "MinifigComponent.h" +#include "CullingPlaneComponent.h" #include "SoundAmbient3DComponent.h" #include "SoundAmbient2DComponent.h" #include "SoundRepeaterComponent.h" @@ -952,6 +953,12 @@ void Entity::Initialize() { if (id > -1) AddComponent(id); break; } + case eReplicaComponentType::CULLING_PLANE: { + // LoadCullingPlaneComponent: the client makes it from the registry + const auto id = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::CULLING_PLANE, -1); + if (id > -1) AddComponent(id); + break; + } default: break; } diff --git a/dGame/dComponents/CullingPlaneComponent.h b/dGame/dComponents/CullingPlaneComponent.h new file mode 100644 index 000000000..b3035d9d4 --- /dev/null +++ b/dGame/dComponents/CullingPlaneComponent.h @@ -0,0 +1,17 @@ +#ifndef CULLINGPLANECOMPONENT_H +#define CULLINGPLANECOMPONENT_H + +#include "Component.h" +#include "eReplicaComponentType.h" + +/** + * A plane the client culls rendering with, as the client's LoadCullingPlaneComponent makes it; the server sends nothing for it. + */ +class CullingPlaneComponent final : public Component { +public: + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::CULLING_PLANE; + + CullingPlaneComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {} +}; + +#endif // CULLINGPLANECOMPONENT_H