Recast Navigation

Yo @Cedric … I am still getting jitter when trying to rotate the agent using the agentVelocity.

Do you know of ANY other way to handle rotation ???

Is there a way to expose the current Waypoint position so i can rotate the agent in that direction ???

Also… using the agent velocity to get the direction does not work to well when moving across off mesh links… Whatever the rotation the agent was in when it hits the off mesh link it stays in until the hit the end off mesh link… then it correctly rotates

Please take a look at how i am rotating the agent on each frame based of agent velocity

private static DEG_UNIT:number = (Math.PI / 360);
private static TARGET_ANGLE:number = (Math.PI * 0.5);
public minimumVelocity:number = 1.5;
const position:BABYLON.Vector3 = this.getAgentPosition();
const velocity:BABYLON.Vector3 = this.getAgentVelocity();
if (this.updateRotation === true) {
    if (velocity.length() >= this.minimumVelocity) {
        velocity.normalize();
        // ..
        const dir:BABYLON.Vector3 = this.m_agentDirection.clone();
        const factor:number = (BABYLON.NavigationAgent.DEG_UNIT * this.angularSpeed * 0.5);
        this.m_agentDirection.set((dir.x + (velocity.x - dir.x) * factor), (dir.y + (velocity.y - dir.y) * factor), (dir.z + (velocity.z - dir.z) * factor));
        this.m_agentDirection.normalize();
        // ..
        const targetAngle:number = (BABYLON.NavigationAgent.TARGET_ANGLE - Math.atan2(this.m_agentDirection.z, this.m_agentDirection.x));
        BABYLON.Quaternion.FromEulerAnglesToRef(0.0, targetAngle, 0.0, this.transform.rotationQuaternion);
    }
}
if (this.updatePosition === true) {
    position.y += (this.baseOffset + this.heightOffset);
    this.transform.position.copyFrom(position);
}

But still jitters… I saw the example you listed before… It does not handle rotation though. Do you know of any recast/detour examples that rotate the agent when moving in response to a agent.goto call ???