# Box-bounded PointLightComponent

**URL:** <https://forums.unrealengine.com/t/box-bounded-pointlightcomponent/420445>\
**Category:** C++\
**Tags:** point-light, bounding-box, unreal-engine, Lighting, CPP, question\
**Created:** [March 21, 2018, 12:43pm UTC](https://forums.unrealengine.com/t/box-bounded-pointlightcomponent/420445 "2018-03-21T12:43:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xpalan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xpalan](https://forums.unrealengine.com/u/xpalan)\
**Post date:** [March 21, 2018, 12:43pm UTC](https://forums.unrealengine.com/t/box-bounded-pointlightcomponent/420445/1 "2018-03-21T12:43:34Z")

</div>

Hello,

I’m using dynamic lights, placed procedurally in procedural rooms. And I faced to the limitation that only 4 Movable shadowed lights can intersect each other.

So I would like to bound a UPointLightComponent by adjacent FBoxes to make it affect the world only within those given FBoxes. This could help with more strict separation of light groups from each other, since box-aligned PointLight bounds better fit to rectangular rooms, rather then current spherical ones.

As far as I understand, it could be achieved in C++ by overriding methods **AffectsBounds()** and **GetBoundingBox()** in **FPointLightPolicy** struct, like it’s done for **USpotLightComponent** in UE4 sources.

* * *
--- Is my guess about overriding those methods correct - or it could be done in simpler way? 
* * *

I tried to override **UPointLightComponent** and **FPointLightPolicy** in my code, but an access to **FPointLightPolicy** requires file _Runtime/Engine/Private/PointLightSceneProxy.h_ to be included. This file resides in a **Private** folder and internally uses some RHI-related things, which need RHI-related libs while linking. So I was unable to compile it because of these linking errors:

1\>Module.IM.cpp.obj : error LNK2019: unresolved external symbol “\_\_declspec(dllimport) unsigned int \_\_cdecl RHIGetShaderLanguageVersion(enum EShaderPlatform)” (\__imp_?RHIGetShaderLanguageVersion@@YAIW4EShaderPlatform@@@Z) referenced in function "public: virtual bool \_\_cdecl FBoxLightSceneProxy::GetWholeSceneProjectedShadowInitializer(class FSceneViewFamily const &,class TArray \> &)const " (?GetWholeSceneProjectedShadowInitializer@FBoxLightSceneProxy@@UEBA\_NAEBVFSceneViewFamily@@AEAV?$TArray@VFWholeSceneProjectedShadowInitializer@@anonymous_user_e71e0d8a1?$TInlineAllocator@$05VFDefaultAllocator@@@@@@@Z)

1\>Module.IM.cpp.obj : error LNK2019: unresolved external symbol “\_\_declspec(dllimport) public: void \_\_cdecl FRHICommandSetScissorRect::Execute(class FRHICommandListBase &)” (\__imp_?Execute@FRHICommandSetScissorRect@@QEAAXAEAVFRHICommandListBase@@@Z) referenced in function “public: virtual void \_\_cdecl FRHICommand::ExecuteAndDestruct(class FRHICommandListBase &,struct FRHICommandListDebugContext &)” (?ExecuteAndDestruct@?$FRHICommand@UFRHICommandSetScissorRect@@@@UEAAXAEAVFRHICommandListBase@@AEAUFRHICommandListDebugContext@@@Z)

1\>Module.IM.cpp.obj : error LNK2019: unresolved external symbol "\_\_declspec(dllimport) public: bool \_\_cdecl FRHICommandList::IsOutsideRenderPass(void)const " (\__imp_?IsOutsideRenderPass@FRHICommandList@@QEBA\_NXZ) referenced in function "public: virtual void \_\_cdecl FPointLightSceneProxyBase::SetScissorRect(class FRHICommandList &,class FSceneView const &,struct FIntRect const &)const " (?SetScissorRect@FPointLightSceneProxyBase@@UEBAXAEAVFRHICommandList@@AEBVFSceneView@@AEBUFIntRect@@@Z)

1\>Module.IM.cpp.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) class FRHICommandListExecutor GRHICommandList” (\__imp_?GRHICommandList@@3VFRHICommandListExecutor@@A)

(FBoxLightSceneProxy is a child of TPointLightSceneProxy with overriden methods)

* * *
--- Is there any way to override \*\*UPointLightComponent\*\* and \*\*FPointLightPolicy\*\* without recompiling UE4 from sources?
* * *

I use UE 4.19.0, MS Visual Studio 2017.

Any help on this point would be greatly appreciated 🙂

Thank you.

---

<div class="post-metadata">

**Author:** ![C64debug](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@C64debug](https://forums.unrealengine.com/u/C64debug)\
**Post date:** [March 29, 2021, 9:25am UTC](https://forums.unrealengine.com/t/box-bounded-pointlightcomponent/420445/2 "2021-03-29T09:25:14Z")

</div>

Weirdly enough, I was trying to do the same thing 3 years later ^^\_
