C:/irrlicht/IrrLib/IrrSphere.cpp

Go to the documentation of this file.
00001 /*
00002     Irrlicht Library Wrapper
00003     Created by Nathan Adams
00004     Copyright (C) 2007
00005 
00006     This software is licensed under the GNU/GPL.
00007     This software may not be used for commerical purposes.
00008 */
00009 #include <iostream>
00010 #include "IrrLib.h"
00011 #include "IrrSphere.h"
00012 #include <irrlicht.h>
00013 #include <strings.h>
00014 
00015 using namespace irr;
00016 using namespace core;
00017 using namespace scene;
00018 using namespace video;
00019 using namespace io;
00020 using namespace gui;
00021 
00022 using namespace std;
00023 
00024 /*void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
00025     this->smgr = smgr;
00026 }
00027 
00028 void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
00029     this->driver = driver;
00030 }*/
00031 
00032 IrrObj IrrSphere::CreateNewSphereNode(int x, int y, int z, stringc texture, bool light){
00033     //this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
00034         //this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z));
00035         //this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
00036         //this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
00037         IrrObj ret;
00038         nodeNew = this->smgr->addSphereSceneNode();
00039         nodeNew->setPosition(core::vector3df(x,y,z));
00040         nodeNew->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
00041         nodeNew->setMaterialFlag(video::EMF_LIGHTING, light);
00042         sphereNodes.push_back(nodeNew);
00043         this->numNodes++;
00044         ret.objectid = this->numNodes--;
00045         return ret;
00046         /*this->node = this->smgr->addSphereSceneNode();
00047         this->node->setPosition(core::vector3df(x,y,z));
00048         this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
00049         this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
00050 }
00051 
00052 irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
00053         //We are converting to vectors, under construction NA
00054     //return this->nodeNew[sphere]->getPosition();
00055     return this->sphereNodes[sphere]->getPosition();
00056 }
00057 
00058 void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
00059     this->sphereNodes[sphere]->setPosition(v);
00060 }
00061 
00062 IrrSphere::IrrSphere(){
00063     this->numNodes = 0;
00064 }
00065 
00066 IrrSphere::~IrrSphere(){
00067     /*for(int i = 0; i < numNodes; ++i)
00068         delete this->nodeNew[i];
00069 
00070     delete this->nodeNew;*/
00071         //We are using vectors now, no more memory clowing business NA
00072 }

Generated on Thu Dec 27 18:25:19 2007 for IrrLib by  doxygen 1.5.4