Slope Troubles

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
davidjohnharrison
Posts: 7
Joined: Wed Nov 09, 2005 5:43 pm

Slope Troubles

Post by davidjohnharrison »

Before I start, I would just like to say that I Have searched the forums, but found no solutions to this problem exept to use Newton.

I was wondering whether or not it is possible to do slope collisions in Irrlicht without having to use something else (like Newton) and without having to create a ridiculously large collision ellipsoid (which wouldn't be very realistic).

At the moment, the camera randomly stops for no apparent reason on a slope, or indeed any sort of incline, unless the height of the collision ellipsoid is larger than something like 1000. Obiously, this does not produce very good results.

The code is the same as tutorial 7: Collision, but with a different model. I have played around with it a bit, but not been able to solve it.

Also, if I have to use Newton, does anybody know where to find out how to use it with Irrlicht, and is it possible to use Irrlicht specific things like heightmaps with just the Newton engine's collision detection?

Thank you in advance.

-David-

EDIT: Ok, it doesnt work with the collision ellipsiod's height at 1000. Please help! :(
magicat
Posts: 19
Joined: Sun Apr 09, 2006 6:52 am

Post by magicat »

I'm not sure, but I think that may just be the default behavior for FPS camera nodes when they have collisions, since it wouldnt be realistic for some one to walk straight up a steep hill. I'm sure there is a way to change it, but I'm not sure how. As for Newton, you should be able to use Irrlicht specific things with it easily, and theres a nice tutorial on integrating Irrlicht with Newton on the main tutorial page at http://irrlicht.sf.net.
davidjohnharrison
Posts: 7
Joined: Wed Nov 09, 2005 5:43 pm

Post by davidjohnharrison »

Thanks alot for your help :D

Just to make sure I have explaned properly, I mean the node wont move up slopes. However, I have seen a few examples of Newton and can see the potential of the physics, including slope movement, and the potential to make a great game if merged with Irrlichts graphics capabilities.

I looked at the tutorial you posted and downloaded the source. I do not actually have Newton, so I couldn't delve into the code. I am not 100% sure what parts are Irrlicht or Newton, but am I correct in thinking that Newton handles the physics, Irrlicht does the mesh calculations and...is it Newton that loads/draws the models?

Sorry for being so clueless :shock: I shall definately download Newton ASAP.

Thanks again

-David-
Baal Cadar
Posts: 377
Joined: Fri Oct 28, 2005 10:28 am
Contact:

Post by Baal Cadar »

Irrlicht does the graphics, while Newton does the physics and collisions. I'd propose the use of Newton or another Physics/Collision-library for that matter too.

I often here, that someone doesn't want to have too much hassle and rather not use an additional library for this. But, frankly, the opposite is true. Not using a physics/collision lib is the hassle here. They are all highly optimised and provide a more direct interface for the problem at hand, than any rendering library can ever do. Keep Rendering Libs for rendering and physics/collision libs for physics.

In the case of slopes, using a trimesh collision for your world/level and an elipsoid or capsule primitive for your player is a good way to go here. Ellipsoids and capsules work very well with slopes, as they don't have any corners.

Newton-SDK contains an example for how to do character control. I believe it is tutorial 7 or 8.
bearSoft
Posts: 165
Joined: Fri Apr 01, 2005 9:55 pm
Location: Denmark

Post by bearSoft »

Code: Select all

At the moment, the camera randomly stops for no apparent reason on a slope, or indeed any sort of incline, unless the height of the collision ellipsoid is larger than something like 1000
-yes, but this has indeed been discussed. i think the topic would be something like 'stuck' or even 'fall through' (whitch is the next that happens ..:)

it seams that the 'spacing' in the map mesh affect the moving nodes capabillity to move on slopes(?!)
eg -u can resolve the situation by using a finer map-mash (drawback==less fps) :(

..if u want to try something -really- puzzling find a place on the map where u cant 'climp up'
turn the cameranode 180 dg
move backwards up the -same- slope
-amusing- aint it?!
Regards.
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
davidjohnharrison
Posts: 7
Joined: Wed Nov 09, 2005 5:43 pm

Post by davidjohnharrison »

@Baal Cadar
Thanks alot for the help. I don't mind the 'hassle' of using another Physic/Collision library, I am just a tad concerned with how compatible Newton and Irrlicht are with each other, but I suppose that many people use them both, so they must be compatible enough. I am having a bit of trouble with my internet at the moment, so I can't download :( but I will as soon as I can.

@bearSoft
I am not quite sure what you mean about moving backwards up the -same- slope. I did what you said and rotated the node 180 degrees when I got stuck and moved backwards, but nothing happened when I tried to move up the slope, and I was still stuck. However, I have noticed that the camera seems to get stuck more if it is looking up, and not at the slope. :) The mesh is quite fine, and it happens with heightmaps too. Clearly Irrlicht isn't very good at collisions (so I have heard others say). I'll try making it even finer (without crashing the PC :D ). Thanks for the help :)
Post Reply