Commit 8b5ed2bc authored by hybrid's avatar hybrid

Change addShadowVolumeSceneNode to replace the current shadow completely. This...

Change addShadowVolumeSceneNode to replace the current shadow completely. This allows to change the shadow parameters, such that a call to addShadowVolumeSceneNode will always result in the correct shadow. Note that redundant calls to this method will be quite expensive now, so avoid them.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3477 dfc29bdd-3216-0410-991c-e03cc46cb475
parent ac1d878a
...@@ -559,18 +559,18 @@ u32 CAnimatedMeshSceneNode::getMaterialCount() const ...@@ -559,18 +559,18 @@ u32 CAnimatedMeshSceneNode::getMaterialCount() const
//! Creates shadow volume scene node as child of this node //! Creates shadow volume scene node as child of this node
//! and returns a pointer to it. //! and returns a pointer to it.
IShadowVolumeSceneNode* CAnimatedMeshSceneNode::addShadowVolumeSceneNode(const IMesh* shadowMesh, IShadowVolumeSceneNode* CAnimatedMeshSceneNode::addShadowVolumeSceneNode(
s32 id, bool zfailmethod, f32 infinity) const IMesh* shadowMesh, s32 id, bool zfailmethod, f32 infinity)
{ {
if (!SceneManager->getVideoDriver()->queryFeature(video::EVDF_STENCIL_BUFFER)) if (!SceneManager->getVideoDriver()->queryFeature(video::EVDF_STENCIL_BUFFER))
return 0; return 0;
if (Shadow)
return Shadow;
if (!shadowMesh) if (!shadowMesh)
shadowMesh = Mesh; // if null is given, use the mesh of node shadowMesh = Mesh; // if null is given, use the mesh of node
if (Shadow)
Shadow->drop();
Shadow = new CShadowVolumeSceneNode(shadowMesh, this, SceneManager, id, zfailmethod, infinity); Shadow = new CShadowVolumeSceneNode(shadowMesh, this, SceneManager, id, zfailmethod, infinity);
return Shadow; return Shadow;
} }
......
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