Dynamic Light ...->getLightData()

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
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Dynamic Light ...->getLightData()

Post by arras »

I want to acces values of ILightSceneNode. Manual says that it should be possible via ILightSceneNode::getLightData() function.

Here is description of function from doc:
virtual video::SLight& irr::scene::ILightSceneNode::getLightData ( ) [pure virtual]
Returns:
Returns the light data.


So if I understand it right it should return adress of SLight

Here is my code:

Code: Select all

ILightSceneNode *light = smgr->addLightSceneNode(0,
   vector3df(-200,-200,500), SColorf(1.0f, 1.0f, 0.0f, 1.0f), 1000.0f);

SLight *lm;
*lm = light->getLightData();
lm->DiffuseColor = SColorf(1.0f, 1.0f, 1.0f, 1.0f);
code compile but program crashes at the begining...
Any idea whats wrong?
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

Yes,
try this

SLight *lm =&light->getLightData();
or in your code
lm = &light->getLightData();
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

etcaptor>> that's it! Thanks a lot :)
Post Reply