/* Irrlicht Library Wrapper Created by Nathan Adams Copyright (C) 2008 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; }*/ IrrObj IrrSphere::CreateNewSphereNode(int x, int y, int z, stringc texture, bool light){ //this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode(); //this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z)); //this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str())); //this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light); IrrObj ret; nodeNew = this->smgr->addSphereSceneNode(); nodeNew->setPosition(core::vector3df(x,y,z)); nodeNew->setMaterialTexture(0, this->driver->getTexture(texture.c_str())); nodeNew->setMaterialFlag(video::EMF_LIGHTING, light); sphereNodes.push_back(nodeNew); this->numNodes++; ret.objectid = this->numNodes--; return ret; /*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){ //We are converting to vectors, under construction NA //return this->nodeNew[sphere]->getPosition(); return this->sphereNodes[sphere]->getPosition(); } void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){ this->sphereNodes[sphere]->setPosition(v); } IrrSphere::IrrSphere(){ this->numNodes = 0; } IrrSphere::~IrrSphere(){ /*for(int i = 0; i < numNodes; ++i) delete this->nodeNew[i]; delete this->nodeNew;*/ //We are using vectors now, no more memory clowing business NA }