To fix this error, you will need to replace:
- Code: Select all
bool OnEvent(SEvent event) {
with
- Code: Select all
virtual bool OnEvent(const SEvent& event) {
and that should fix it
Sorry for any inconvienence!!!
-DudMan
bool OnEvent(SEvent event) {
virtual bool OnEvent(const SEvent& event) {


int main() {
IrrlichtDevice *device = createDevice(ETD_OPENGL);
IVideoDriver* video = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
while(device->run() && device) {
driver->beginScene(true, true, video::SColor(255,0,0,255));
smgr->drawAll();
driver->endScene();
}
}

ICameraSceneNode* cam = smgr->addCameraSceneNode(0, vector3df(0,30,-45));
or, another more "accurate" collision function:
Code:
bool collision(ISceneNode* one, ISceneNode* two) {
if(one->getBoundingBox().intersectsWithBox(two->getBoundingBox())) {
return true;
return false;
}
havent tested this one but it should work.
int lastFPS = -1;
anms->setDebugDataVisible(scene::EDS_FULL);
node->setDebugDataVisible(scene::EDS_FULL);
n->setDebugDataVisible(scene::EDS_FULL);
while(device->run())
{
if(n->getBoundingBox().intersectsWithBox(node->getBoundingBox()))
printf("Collision Detected");
MasterGod wrote:or, another more "accurate" collision function:
Code:
bool collision(ISceneNode* one, ISceneNode* two) {
if(one->getBoundingBox().intersectsWithBox(two->getBoundingBox())) {
return true;
return false;
}
havent tested this one but it should work.
It doesn't seem to work.
Add those lines to example 4:
- Code: Select all
int lastFPS = -1;
anms->setDebugDataVisible(scene::EDS_FULL);
node->setDebugDataVisible(scene::EDS_FULL);
n->setDebugDataVisible(scene::EDS_FULL);
while(device->run())
{
if(n->getBoundingBox().intersectsWithBox(node->getBoundingBox()))
printf("Collision Detected");
You'll see what I mean by doing it..

or, another more "accurate" collision function:
Code:
bool collision(ISceneNode* one, ISceneNode* two) {
if(one->getBoundingBox().intersectsWithBox(two->getBoundingBox())) {
return true;
return false;
}
havent tested this one but it should work.

shadowslair wrote:This is a really nice tutorial. Still can be improved though. Adding fixed and working versions of the codes will be really nice. I don`t think that there are much guys so fallen in love with the old versions to use it.
or, another more "accurate" collision function:
Code:
bool collision(ISceneNode* one, ISceneNode* two) {
if(one->getBoundingBox().intersectsWithBox(two->getBoundingBox())) {
return true;
return false;
}
havent tested this one but it should work.
Yeah, actually this always returns "true". I would like to know what`s wrong with it too (if possible).
Anyway, this tut is really useful, since it helped me understand some basic stuff. "Working and learning" seems to be a good startegy

But it Should work, doesn't it?

Return to FAQs, Tutorials, Howtos, and external tool lists
Users browsing this forum: No registered users and 0 guests