Page 1 of 1

How to remove shadow from IAnimatedMeshSceneNode

Posted: Wed Jun 08, 2005 4:01 am
by Tooh
The following code, I added shadow to mesh.

Code: Select all

scene::ISceneManager *pSceneManager;
pSceneManager = pIrrlichtDevice->getSceneManager();

scene::IAnimatedMeshSceneNode *pAnimatedMeshSceneNode;
pAnimatedMeshSceneNode = pSceneManager->addAnimatedMeshSceneNode(pSceneManager->getMesh("Mesh.md2"));

scene::IShadowVolumeSceneNode *pShadowVolumeSceneNode;
pShadowVolumeSceneNode = pAnimatedMeshSceneNode->addShadowVolumeSceneNode();

scene::ISceneNode *pLightSceneNode;
pLightSceneNode = pSceneManager->addLightSceneNode(0, 0, 0x00ff0000, 40.0f);
pLightSceneNode = pSceneManager->addBillboardSceneNode(pLightSceneNode, core::dimension2d<f32>(128, 128));
pLightSceneNode->setMaterialTexture(0, pVideoDriver->getTexture("Light.bmp"));
I want to know:
1. How to remove pLightSceneNode (that has a BillboardSceneNode) from pSceneManager.
2. How to remove pShadowVolumeSceneNode from pAnimatedMeshSceneNode.

Please help. :(

Posted: Wed Jun 08, 2005 6:39 pm
by Myth
If oyu don't want a shadow just don't create one.
If you want to realtime delete it you can try this:

Code: Select all

pShadowVolumeSceneNode->drop();
// or maybe
pAnimatedMeshSceneNode->addShadowVolumeSceneNode(0,0,false);
It will proberly won't do anything or give an expection..
And the 2nd thing is bad coding.
You can give it a try I guess..

- Myth