edit: I posted this before you made your last post, please try what I sad I beleive this is the problem.
I can't really step on the code the mouse the way it is now, but when I look at the code
I see this in the update function.
- Code: Select all
void NewtonDynamicsCharacterController::Update(const float step)
{
///
//Print(GetChild(0)->GetPosition(true));
CharacterController::Update(1.0);
if (asleep) return;
I do not see the place where variable asleep is set, and I do not know if the player is a newton dynamics body, I assuming it is just a shape that you move around because if it was a kinematic body the other dynamics body will see the incoming shape, at least that's how it works on the demos.
if this is correct, you said this worked before, but that code could have never work on any newton version, but you can fix very easily.
the first thing you can do to verify if this solve the problem is comment out line
- Code: Select all
if (asleep) return;
this will allows the collision test run every time and show if it solves the problem.
the next step is to optimize it so that asleep has effect, for this you can modify the function like this.
- Code: Select all
CharacterController::Update(1.0);
bool hasclosebody = GetAdjacentBodies();
if (asleep || hasclosebody) return;
here you modify GetAdjacentBodies so that it test if any dynamics body can potentially collide with the player. something as eassy as this can do it.
The return value if GetAdjacentBodies is the Boolean Or of each dynamic body who's velocity is different than zero.
I believe that should take care of that problem.