Properly parent light nodes and add them to the scene manager

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14885 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2014-01-02 01:35:42 +00:00
parent ea7231170a
commit 4c11ca65f0
2 changed files with 2 additions and 2 deletions

View File

@ -2121,6 +2121,7 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy,
{
if (m_glsl)
{
if (parent == NULL) parent = m_scene_manager->getRootSceneNode();
LightNode *light = NULL;
if (!sun)
@ -2129,7 +2130,6 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy,
light = new SunNode(m_scene_manager, parent, r, g, b);
light->grab();
light->setParent(NULL);
light->setPosition(pos);
light->updateAbsolutePosition();

View File

@ -740,7 +740,7 @@ void IrrDriver::renderLights(const core::aabbox3df& cambox,
light_node->setEnergyMultiplier(std::min(1.0f, em + dt));
}
const core::vector3df &pos = light_node->getPosition();
const core::vector3df &pos = light_node->getAbsolutePosition();
accumulatedLightPos.push_back(pos.X);
accumulatedLightPos.push_back(pos.Y);
accumulatedLightPos.push_back(pos.Z);