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