collision with .irr maps

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
xfreakk
Posts: 14
Joined: Thu Nov 15, 2007 1:58 pm

collision with .irr maps

Post by xfreakk »

Hi everyone I know that there is an example for collision in q3 maps but im not sure how to port this for an Irr map.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

I profess ignorance of all thing IrrEdit, but it strikes me as a very good idea to add an .irr to the sample media and to at least one of the example projects. Does anyone who uses IrrEdit fancy doing that?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
xfreakk
Posts: 14
Joined: Thu Nov 15, 2007 1:58 pm

Post by xfreakk »

i use irredit because of simplicity. Im not an a mapper or modeler so i just need maps to test out my stuff. I guess i could test out my code on q3 maps.
But yea there is only one example on irr maps.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Example 15 already loads from .irr file and so we also have an example. Just no collision response there. But one can find mayn of such example in this forum.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Oh, the cunningly titled "LoadIrrFile" example. I guess that demonstrates that not only do I not use IrrEdit, that I have some sort of hysterical blindness regarding it. ;)
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Deuce
Posts: 3
Joined: Fri Nov 16, 2007 5:48 am

Post by Deuce »

Check out the wiki at "http://www.irrlicht3d.org/wiki/index.ph ... gCollision" That has everything you need =), there is an error in the code, he uses "and" instead of "&&"
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

That's not an error, it's just another keyword which can be used in place of &&. However, it's less known to C/C++ programmers.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

hybrid wrote:That's not an error, it's just another keyword which can be used in place of &&. However, it's less known to C/C++ programmers.
Um... which C/C++ compilers treat 'and' as a keyword?
Last edited by rogerborg on Fri Nov 16, 2007 6:24 pm, edited 1 time in total.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

Maybe gcc allows them, but Visual C++ and Borland don't. But it is indeed part of the C++ standard. ISO 14882 sections 2.5 and 2.11.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Yes, these alternative tokens are indeed part of the C++ standard. Unfortunately the Microsoft compiler disables the functionality as an extension that is enabled by default.

If you compile with /Za to disable extensions or include iso646.h the alternative tokens work fine. You should not be required to include the header, but the Microsoft compiler uses this to allow them to disable the extension by default and still provide a way for users to have access to the language feature.

Here is the compile result [msvc7.1]

Code: Select all

C:\Documents and Settings\tvitek>type u.cpp
int main ()
{
  return 1 and 3;
}
C:\Documents and Settings\tvitek>cl /nologo t.cpp
t.cpp
t.cpp(218) : error C2146: syntax error : missing ';' before identifier 'and'
t.cpp(218) : error C2065: 'and' : undeclared identifier
t.cpp(218) : error C2143: syntax error : missing ';' before 'constant'

C:\Documents and Settings\tvitek>cl /nologo /Za t.cpp
t.cpp

C:\Documents and Settings\tvitek>
Here are links to the MSDN docs on the subject of extensions...
msvc71
msvc80

Travis
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Well, you live and learn. Thanks for the references, chaps. I guess I'm just an old fashioned C Luddite at heart. ;)
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

I didn't know that either, always nice to learn something new.
I've changed the example to use && though, to avoid future confusion :)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Yeah, there are many things in the C++ standard that most guys don't know. I pick up some interesting tidbit every few days just reading the standard as part of my work.

Travis
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi. Not sure you have been answered. For quick response.

1. You will have to load your level as an OCCTREE in IRREDIT
2. Take this snippet code (working with IRRlicht 1.2 and 1.3.1)
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=23707

This snippet was created mostly by things learned from Vitek(Travis). I'm using it to load all my levels and apply collision to the environnement. The only thing that is neccessary is that you load your mesh as an OCCTREE in IRRedit (The snippet will search the scene graph and put all the OCCTREE in selector, add them to the metaselector that will be used in the collisionResponseAnimator for the camera).
Lorka
Posts: 1
Joined: Thu Nov 22, 2007 3:58 am

Post by Lorka »

Christianclavet, if you've built a map in 3DS and import to Edit as an Octree, Edit won't light it. Whats the best way to light the scene before importing as an Octree?
Post Reply