character-> hills & stairs

yuriythebest

24-01-2008 15:04:35

I've searched the forum but didn't find anything regarding this. By default if a character is on top of an uneven surface (in my case a blob-like thing) he has no problem sliding down, but to get up again, even if the slope is extremely low he still has to jump like so:



how do I make him climb up?

betajaen

24-01-2008 16:01:49

The slope limit isn't probably high enough. You can find it in ActorParams::mSlopeLimit, the value must be expressed as a radian.

p.s. Nice graphic.

yuriythebest

24-01-2008 16:31:43

right, it appears that I was mistaken and that if the slope is very gentle the character will indeed be able to go upwards, however I tried setting mSlopeLimit to 1 in NxOgreCharacter.cpp in Character::Character, which should equal around 90 degrees and thus allow the character in theory to climb over any obstacle, however in the tests nothing has changed. when I type ActorParams:: in my project there is no parameter mSlopeLimit.

betajaen

24-01-2008 17:27:24

It is there:-

http://svn.nxogre.org/branches/0.9/NxOg ... ntroller.h

SiWi

25-01-2008 10:35:16

90° should be 0.5* Pi = 0.5*3.14 = 1.57. You have about 57°.

yuriythebest

12-02-2008 16:25:21

sorry for bringing this old topic back but I still haven't resolved my issue.

in NxOgreCharacterController.h I changed mSlopeLimit to public and in my app I have:

mCharacter->mSlopeLimit=1.57;


however nothing has changed and the character still gets stuck

betajaen

12-02-2008 16:57:54

That's just a read-only variable that has no effect on the NxCharacter than this mug here on my desk. You need to set the slope limit in the CharacterParams.

Arcanor

03-03-2008 16:30:46

I'm having the same problem. I'm creating the character with the following:

mScene->createCharacter(entName, NxOgre::Pose(position, orientation), "type: capsule, slopelimit: 1.56");

However, I can't climb even moderate slopes. Am I doing something wrong?

Arcanor

03-03-2008 17:40:22

Ok, I've solved this problem now!

The issue is that the slopelimit is not actually a Radian at all (sorry to correct you betajaen)! It's the cosine of the desired angle that can be climbed. See nxcontroller.h line 232 for reference.

The default slopelimit value of 0.707 corresponds to a 45 degree slope. The slopelimit should always be between 0 and 1 for useful values (not sure what it would do outside that range).

Higher values of slopelimit will correspond to a LOWER traversible slope, while lower values of slopelimit will correspond to a HIGHER angle that can be climbed.

For example, I'm now using slopelimit of 0.01 and that is giving a superhuman ability to climb nearly vertical slopes.

However, there's one more piece of the puzzle. Especially with very low values of slopelimit, you may start to run into limitations based on your "stepoffset", which limits the amount of height you are allowed to climb at one time, regardless of the slope. The default value of stepoffset is 0.5, which works for most "normal" values of slopelimit. But I found that I had to set it to a higher value (I set it to 5.0) to allow my character to climb huge cliffs for testing purposes.

I hope this explanation helps someone, as it took a lot of trial and error to get it right. ;)