/* Irrlicht Library Wrapper Created by Nathan Adams Version 1.1 Copyright (C) 2007 This software is licensed under the GNU/GPL. This software may not be used for commerical purposes. */ #include #include "IrrLib.h" #include "IrrSphere.h" #include #include using namespace irr; using namespace core; using namespace scene; using namespace video; using namespace io; using namespace gui; using namespace std; void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){ this->smgr = smgr; } void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){ this->driver = driver; } int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){ //TODO: Resize after 10, and add 10 more to the mix! this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode(); this->nodeNew[this->numNodes]->setPosition(core::vector3df(x,y,z)); this->nodeNew[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str())); this->nodeNew[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light); this->numNodes++; return this->numNodes--; /*this->node = this->smgr->addSphereSceneNode(); this->node->setPosition(core::vector3df(x,y,z)); this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str())); this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/ } irr::core::vector3df IrrSphere::GetSphereVector(int sphere){ return this->nodeNew[sphere]->getPosition(); } void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){ this->nodeNew[sphere]->setPosition(v); } IrrSphere::IrrSphere(){ this->numNodes = 0; } IrrSphere::~IrrSphere(){ for(int i = 0; i < numNodes; ++i) delete this->nodeNew[i]; delete this->nodeNew; }