[no bug]SLight and Radius

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

[no bug]SLight and Radius

Post by ent1ty »

Hi, I noticed that if I set the light data through the SLight struct, the light's range becomes neverending.
E.g.

Code: Select all

ILightSceneNode* flashlight;
flashlight= smgr->addLightSceneNode(0, vector3df(0,10,0), SColorf(1,0.8,0.8), 20);
SLight flashlightData;
flashlightData.Direction= camera->getRotation();
flashlightData.OuterCone= 20;
flashlightData.Position= camera->getPosition();
flashlightData.Falloff= 30;
flashlightData.Type= ELT_SPOT;
[b]flashlightData.Radius= 20;[/b]
flashlight->setLightData(flashlightData);
flashlight->setParent(camera);
Although the Radius is set to 20, the light illuminates entire space. But if i set the radius afterwards with flashlight->setRadius(20); command, it works fine.
Just thought you should know.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

That's why those fields are marked as read-only.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

But Type is marked as read-only too and it can be changed :roll:
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, there are methods in the light type API which have to be used.
Post Reply