[1.10] Ogre::Light::setDirection depricated - alternative?

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
BohdanKornienko
Halfling
Posts: 43
Joined: Sat Nov 01, 2014 10:26 pm

[1.10] Ogre::Light::setDirection depricated - alternative?

Post by BohdanKornienko »

So this method is deprecated.

The documentation says:
only call with Vector3::NEGATIVE_UNIT_Z, then attach to SceneNode and use SceneNode::setDirection

Code: Select all

    
    Light* directionalLight = scnMgr->createLight("DirectionalLight");
    directionalLight->setType(Light::LT_DIRECTIONAL);

    directionalLight->setDiffuseColour(ColourValue(0.4, 0, 0));
    directionalLight->setSpecularColour(ColourValue(0.4, 0, 0));

    directionalLight->setDirection(Vector3(0, -1, 1));
Makes look like this.

Code: Select all

 
    Light* directionalLight = scnMgr->createLight("DirectionalLight");
    directionalLight->setType(Light::LT_DIRECTIONAL);

    directionalLight->setDiffuseColour(ColourValue(0.4, 0, 0));
    directionalLight->setSpecularColour(ColourValue(0.4, 0, 0));

    directionalLight->setDirection(Vector3::NEGATIVE_UNIT_Z);

    SceneNode* directionalLightNode = scnMgr->getRootSceneNode()->createChildSceneNode();
    directionalLightNode->attachObject(directionalLight);
    directionalLightNode->setDirection(Vector3(0, -1, 1));
And this is a bit weird.

I can assume that direction for light by default is not NEGATIVE_UNITZ and it probably will be replaced with it, so that I will be able to delete that extra setDirection call in my code.

Could you give me a hint if I am wrong here. If I am not. What the motivation of doing this way?
Thanks in advance.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: [1.10] Ogre::Light::setDirection depricated - alternativ

Post by paroj »

I can assume that direction for light by default is not NEGATIVE_UNITZ and it probably will be replaced with it, so that I will be able to delete that extra setDirection call in my code.
correct.
Could you give me a hint if I am wrong here. If I am not. What the motivation of doing this way?
Thanks in advance.
see http://www.ogre3d.org/2017/09/02/ogre-1 ... erm-report "Deprecation of node-less positioning"
Post Reply