Question about collision detection and response
Posted: Thu Jan 18, 2007 10:36 pm
So I have all the collisoins set up on the main character and they can run around in a couple of diffrent test levels that I am working on setting up.
One of the test levels so far is just a ITerrainSceneNode, anyhow my character is able to run up really steep hills. Granted they run up it pretty slowely this is not the behavior that I want because I want the player to have to weave around hills/mountains.
So I have an idea to fix it but not sure if it will work due to when the collision detection and response happen.
Does the detection and response happen during a set postion call, or does it happen some time later. (can somone verify)
What I was thinking was somthing like this
Old postion = node->get postion();
node->setPostion(newPostion);
???????*collision and response get updated here???????
currentPostion = node->getPostion();
DeltaY = oldPostion.Y - newPosition.Y
if(DeltaY > x) node->setPostion(oldPostion);
So if I can't do what I have listed above do you guys have any othe suggestions that I could?
Sorry for not posting my current code, I am at work right now I can get it put up tonight if needed
One of the test levels so far is just a ITerrainSceneNode, anyhow my character is able to run up really steep hills. Granted they run up it pretty slowely this is not the behavior that I want because I want the player to have to weave around hills/mountains.
So I have an idea to fix it but not sure if it will work due to when the collision detection and response happen.
Does the detection and response happen during a set postion call, or does it happen some time later. (can somone verify)
What I was thinking was somthing like this
Old postion = node->get postion();
node->setPostion(newPostion);
???????*collision and response get updated here???????
currentPostion = node->getPostion();
DeltaY = oldPostion.Y - newPosition.Y
if(DeltaY > x) node->setPostion(oldPostion);
So if I can't do what I have listed above do you guys have any othe suggestions that I could?
Sorry for not posting my current code, I am at work right now I can get it put up tonight if needed