howto create directional light

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

howto create directional light

Post by Halan »

Hi,

i dont really understand how to make my light directional as there is no setLightData in the Interface nor does the getLightData return a pointer.

atm moment ive this code:

Code: Select all

    ILightSceneNode* sun = smgr->addLightSceneNode(0, vector3df(-25, 5, -25), SColorf(1.0f, 1.0f, 1.0f), 100.0f, -1);
    SLight sunData = sun->getLightData();
    sunData.Type = ELT_DIRECTIONAL;
doesnt work of course as theres no connection between sunData and sun.
can someone explain me how to create a directional light and tell my why theres no simple function in the SceneMananger?

greets;
halan
stef_
Posts: 53
Joined: Tue Apr 18, 2006 9:39 pm
Contact:

Post by stef_ »

I haven't used directional lights but why do you say:
> the Interface nor does the getLightData return a pointer.
> doesnt work of course as theres no connection between sunData and sun.

Code: Select all

virtual video::SLight& getLightData() = 0;
returns not a pointer but a reference, so it's ok...
A reference it's not a copy, it's like a pointer.

Bye
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

but the radius is still affecting the light. should this still be this case?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

If you use a reference instead of a copy (SLight& sundata) you will get this to work...
Post Reply