Procedural Fire Scene Node For Ya.
Posted: Thu Oct 27, 2005 9:29 pm
Hello, dear fellas! I am pleased to present another scene node from my lab to you today. It is a nice fire scene node without the need to use particles. Watch the results:
As with all custom scene nodes, all you have to do is create a new instance, make it a child of the root scene node and drop it.
I'm still using Irrlicht 0.10.0, so there may be some difficulties for the 0.12.0 users because of the ITimer interface. But it shouldn't be too difficult to change, just change this line in the render() method, so that it uses the new timer interface:
u32 deltaTime = timer->getTime() - prevTime;
Link to the code is in my sig
As with all custom scene nodes, all you have to do is create a new instance, make it a child of the root scene node and drop it.
Code: Select all
ISceneNode* fire = new CFireSceneNode(
root, //Parent
smgr, //Scene Manager
device->getTimer(), //ITimer
"cool.tga", //Fadeout texture
SColor(255, 255, 128, 0), //Starting color
2, //Fadeout color (2 - red, 1 - green, 0 - blue)
0.95f, //Fadeout rate (0.0f - 1.0f -> the higher, the less the
//color fades into the fadeout color)
64, //Texture X size
64, //Texture Y size
30, //Width
70, //Height
20, //Update speed
-1, //id
vector3df(0.0f, 20.0f, 0.0f), //Position
vector3df(0.0f, 0.0f, 0.0f) //Rotation
);
fire->drop();
u32 deltaTime = timer->getTime() - prevTime;
Link to the code is in my sig