here is the code for calling select:
Code: Select all
mesh = irrSceneMgr->getMesh("select3.3DS"); //low poly
IAnimatedMeshSceneNode* nodeSel = 0;
if (mesh) {
nodeSel = irrSceneMgr->addAnimatedMeshSceneNode(mesh);
nodeSel->setPosition(vector3df(0,20,0));
nodeSel->setMaterialTexture(0, irrDriver->getTexture("blue.bmp")); // set diffuse texture
nodeSel->addShadowVolumeSceneNode(-1, false);
nodeSel->setMaterialFlag(EMF_LIGHTING, false); // disable dynamic lighting
nodeSel->setMaterialFlag(EMF_GOURAUD_SHADING, false); // remove shading
}
here is event reciever code atm:
Code: Select all
class irrEventReceiver : public IEventReceiver {
public: virtual bool OnEvent(SEvent event) {
if (event.EventType == EET_GUI_EVENT) { //gui event (menu select)
/*
theres some gui menu stuff here, but i dont think its important atm
*/
} // if (event.EventType == EET_GUI_EVENT)
if (nodeSel != 0 && event.EventType == EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown) { //key event (movement)
int temp; // this is a temp var just to see if netin is happenin...
switch(event.KeyInput.Key) {
case KEY_KEY_W: temp = 1; break;
case KEY_KEY_S: temp = 2; break;
case KEY_KEY_A: temp = 3; break;
case KEY_KEY_D: temp = 4; break;
} // switch(event.KeyInput.Key)
} // else if (nodeSel != 0 && event.EventType == EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)
} //public: virtual bool OnEvent(SEvent event)
}; // class irrEventReceiver : public IEventReceiver
as far as i can tell, to move my select node i would have to have code like this:
Code: Select all
vector3df v = nodeSel->getPosition(); //get current pos
v.X/Y/Z += -100.0f; //x/y/z and the amount to + or - from current x/y/z val
nodeSel->setPosition(v); //set new pos
i know it DOES know what keys are being pressed cause it only crashes on WSAD, but, it just doesnt seem to wanna do anything after it figures out what button is pressed heh
im using devc++ and irrlicht 0.9 and opengl as the renderer (if that matters)