00001
00002
00003
00004
00005
00006
00007
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
00025
00026
00027
00028
00029
00030
00031
00032 IrrObj IrrSphere::CreateNewSphereNode(int x, int y, int z, stringc texture, bool light){
00033
00034
00035
00036
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
00047
00048
00049
00050 }
00051
00052 irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
00053
00054
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
00068
00069
00070
00071
00072 }