MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / AddDynamicPointLight

Method AddDynamicPointLight

TombEngine/Renderer/RendererDraw.cpp:1649–1675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1647 }
1648
1649 void Renderer::AddDynamicPointLight(const Vector3& pos, float radius, const Color& color, bool castShadows, int hash)
1650 {
1651 if (_isLocked || g_GameFlow->LastFreezeMode != FreezeMode::None)
1652 return;
1653
1654 if (radius <= EPSILON)
1655 return;
1656
1657 auto dynamicLight = RendererLight{};
1658
1659 dynamicLight.Color = Vector3(color.x, color.y, color.z);
1660 if (radius < BLOCK(2))
1661 dynamicLight.Color *= (radius / BLOCK(2));
1662
1663 dynamicLight.RoomNumber = NO_VALUE;
1664 dynamicLight.Intensity = 1.0f;
1665 dynamicLight.Position = pos;
1666 dynamicLight.In = 1.0f;
1667 dynamicLight.Out = radius;
1668 dynamicLight.Type = LightType::Point;
1669 dynamicLight.CastShadows = castShadows;
1670 dynamicLight.BoundingSphere = BoundingSphere(pos, radius);
1671 dynamicLight.Luma = Luma(dynamicLight.Color);
1672 dynamicLight.Hash = hash;
1673
1674 PrepareDynamicLight(dynamicLight);
1675 }
1676
1677 void Renderer::AddDynamicFogBulb(const Vector3& pos, float radius, float density, const Color& color, int hash)
1678 {

Callers 2

SpawnDynamicPointLightFunction · 0.80
SpawnDynamicLightFunction · 0.80

Calls 2

LumaFunction · 0.85
Vector3Function · 0.50

Tested by

no test coverage detected