//Clouds.cpp by nespa

	#include "..\..\Header Files\Ninfa3D.h"
	#include "..\..\Codes\CCloudSceneNode.h"

	extern ISceneNode* parent;
	extern IrrlichtDevice* device;
	extern IVideoDriver* driver;
	extern ISceneManager* SceneManager;
	


extern "C"
{

/* ----------------------------------------------------------------------------
Adds a clouds object to the scene based on the supplied parameters
*/
DLL_EXPORT void* DLL_APIENTRY nAddClouds( ITexture * txture, u32 lod, u32 depth, u32 density )

{
    // create a cloud node
    scene::CCloudSceneNode* clouds = new scene::CCloudSceneNode(
            SceneManager->getRootSceneNode(), SceneManager,
                device->getTimer(), -1, core::vector3df(0,0,0), core::vector3df(0,0,0), core::vector3df(1,1,1));

    // set the level of details to draw at what distance
    clouds->setLOD(lod);

    // set the maximum detail level when recursing
    clouds->setMaxDepth(depth);

    // call a "here's one I made earlier" function
    clouds->makeRandomCloud(density);

 //   clouds->setLOD(1.0f);

    // for some reason ISceneNode material properties cannot be called from here
    clouds->setMaterialTexture(0,txture);
    clouds->getMaterial(0).Lighting = false;
    clouds->getMaterial(0).MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;

    return (void*)clouds;
}

}
	