Commit fbd31749 authored by cutealien's avatar cutealien

CLightSceneNode::updateAbsolutePosition does now light recalculations. This is...

CLightSceneNode::updateAbsolutePosition does now light recalculations. This is to fix using animators with lights.
Thx @chronologicaldot for report.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5111 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 520f1f27
-------------------------- --------------------------
Changes in 1.9 (not yet released) Changes in 1.9 (not yet released)
- CLightSceneNode::updateAbsolutePosition does now light recalculations. This is to fix using animators with lights.
- Fix collada export for objects with rotations around more than 1 axis. - Fix collada export for objects with rotations around more than 1 axis.
- Add ISceneNodeAnimatorCameraMaya::setTargetMinDistance and getTargetMinDistance. - Add ISceneNodeAnimatorCameraMaya::setTargetMinDistance and getTargetMinDistance.
- Add override font to IGUITreeView - Add override font to IGUITreeView
......
...@@ -34,7 +34,7 @@ CLightSceneNode::CLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, ...@@ -34,7 +34,7 @@ CLightSceneNode::CLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
//! pre render event //! pre render event
void CLightSceneNode::OnRegisterSceneNode() void CLightSceneNode::OnRegisterSceneNode()
{ {
doLightRecalc(); doLightRecalc(); // TODO: since doLightRecalc has now been added to updateAbsolutePosition it might be possible to remove this one.
if (IsVisible) if (IsVisible)
SceneManager->registerNodeForRendering(this, ESNRP_LIGHT); SceneManager->registerNodeForRendering(this, ESNRP_LIGHT);
...@@ -201,6 +201,12 @@ void CLightSceneNode::doLightRecalc() ...@@ -201,6 +201,12 @@ void CLightSceneNode::doLightRecalc()
} }
} }
void CLightSceneNode::updateAbsolutePosition()
{
ILightSceneNode::updateAbsolutePosition();
doLightRecalc();
}
//! Writes attributes of the scene node. //! Writes attributes of the scene node.
void CLightSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const void CLightSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
......
...@@ -88,6 +88,10 @@ public: ...@@ -88,6 +88,10 @@ public:
//! Check whether this light casts shadows. //! Check whether this light casts shadows.
/** \return True if light would cast shadows, else false. */ /** \return True if light would cast shadows, else false. */
virtual bool getCastShadow() const _IRR_OVERRIDE_; virtual bool getCastShadow() const _IRR_OVERRIDE_;
//! Updates the absolute position based on the relative and the parents position
virtual void updateAbsolutePosition() _IRR_OVERRIDE_;
private: private:
video::SLight LightData; video::SLight LightData;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment