INNER CODE UNIT · C++
light
cadaver/turso3d · Turso3DTest/Main.cpp:291
Light* light = scene->CreateChild<Light>();
light->SetStatic(true);
light->SetLightType(LIGHT_POINT);
light->SetCastShadows(true);
Vector3 colorVec = 2.0f * Vector3(Random(), Random(), Random()).Normalized();
light->SetColor(Color(colorVec.x, colorVec.y, colorVec.z, 0.5f));
light->SetRange(40.0f);
light->SetShadowMapSize(256);
light->SetShadowMaxDistance(200.0f);
light->SetMaxDistance(900.0f);
Vector3 newPos;
for (int retries = 30; retries > 0; --retries)
{
newPos = quadrantCenters[i % 4] + Vector3(Random() * 440.0f - 220.0f, 10.0f, Random() * 440.0f - 220.0f);
bool posOk = true;