To fix this error, you will need to replace:
Code: Select all
bool OnEvent(SEvent event) {
Code: Select all
virtual bool OnEvent(const SEvent& event) {
Sorry for any inconvienence!!!
-DudMan
Code: Select all
bool OnEvent(SEvent event) {
Code: Select all
virtual bool OnEvent(const SEvent& event) {
Code: Select all
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();
}
}
Code: Select all
ICameraSceneNode* cam = smgr->addCameraSceneNode(0, vector3df(0,30,-45));
It doesn't seem to work.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.
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");
dudMaN, (or anyone else), you know why it doesn't work?MasterGod wrote:It doesn't seem to work.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.
Add those lines to example 4:You'll see what I mean by doing it..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");
Yeah, actually this always returns "true". I would like to know what`s wrong with it too (if possible).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, tested that out on something(dont remember what) and it always returns true. I'm ganna remove that sometime .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.Yeah, actually this always returns "true". I would like to know what`s wrong with it too (if possible).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.
Anyway, this tut is really useful, since it helped me understand some basic stuff. "Working and learning" seems to be a good startegy
No, no it shouldn't, if you dont return the Transformed bounding box, it just gives you one thats always placed at 0,0.But it Should work, doesn't it?