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));
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));
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.