Hy....
How can I use fog for a .irr???
because, to get fog I enable EMF_FOG_ENABLE from a Mesh. But i have a scene!!!
setFog Problem !!!
If you need to know something the API is your first port of call
If you look up ISceneNode you will find a function called getChildren which returns you a list of all the children so you iterate through each child and set the fog (if necessary) and then iterate through each of those child's children and keep repeating until you've done all the nodes, a recursive function is obviously the best way to achieve this.
If you look up ISceneNode you will find a function called getChildren which returns you a list of all the children so you iterate through each child and set the fog (if necessary) and then iterate through each of those child's children and keep repeating until you've done all the nodes, a recursive function is obviously the best way to achieve this.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Code: Select all
void turnOnFog(scene::ISceneNode * node)
{
switch(node->getType())
{
// Turn on fog for appropriate node types, casting as necessary
default:
// Do nothing
break;
}
}
// Recurses through all the scene nodes, and passes each one to a function that
// does whatever you want with it. To do different things to every node, just
// call this function with a different "action" function parameter.
void recurseThroughAllNodes(scene::ISceneNode * node, void(*action)(scene::ISceneNode *))
{
action(node);
core::list<scene::ISceneNode*> children = node->getChildren();
core::list<scene::ISceneNode*>::Iterator childIterator = children.begin();
core::list<scene::ISceneNode*>::Iterator end = children.end();
while(childIterator != end)
{
recurseThroughAllNodes(*childIterator, action);
childIterator++;
}
}
//...
// Then kick it off from the root of the scene tree by calling..
recurseThroughAllNodes(smgr->getRootSceneNode(), turnOnFog);
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
I have a simple solution )
1. Open your irr file with notepad or vi
2. Replace
with
1. Open your irr file with notepad or vi
2. Replace
Code: Select all
<bool name="FogEnable" value="false" />
Code: Select all
<bool name="FogEnable" value="true" />
Project homepage: http://fosp.wordpress.com/
Project Forum URL: http://forum.gamedev.vn/index.php?showforum=74
Project Google Group: http://groups.google.com/group/fosproject
Engine Project: http://code.google.com/p/fosengine/
Project Forum URL: http://forum.gamedev.vn/index.php?showforum=74
Project Google Group: http://groups.google.com/group/fosproject
Engine Project: http://code.google.com/p/fosengine/
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Oh, well, if you want to do it the easy way, then I suppose that's fine.
Actually, being serious, I doubt that you'd want to switch on fog for all materials, which is why there's a switch() in the sample code above.
Actually, being serious, I doubt that you'd want to switch on fog for all materials, which is why there's a switch() in the sample code above.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way