| 385 | } |
| 386 | |
| 387 | void NavMeshAgent::syncToAgent() |
| 388 | { |
| 389 | if (_crowd) |
| 390 | { |
| 391 | auto agent = _crowd->getEditableAgent(_agentID); |
| 392 | Mat4 mat = _owner->getNodeToWorldTransform(); |
| 393 | agent->npos[0] = mat.m[12]; |
| 394 | agent->npos[1] = mat.m[13]; |
| 395 | agent->npos[2] = mat.m[14]; |
| 396 | // if (_needAutoOrientation){ |
| 397 | // Vec3 vel = mat * _rotRefAxes; |
| 398 | // agent->vel[0] = vel.x; |
| 399 | // agent->vel[1] = vel.y; |
| 400 | // agent->vel[2] = vel.z; |
| 401 | // } |
| 402 | if (_needUpdateAgent) |
| 403 | { |
| 404 | dtCrowdAgentParams ap; |
| 405 | convertTodtAgentParam(_param, ap); |
| 406 | agent->params = ap; |
| 407 | agent->state = _state; |
| 408 | _needUpdateAgent = false; |
| 409 | } |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | Vec3 NavMeshAgent::getVelocity() const |
| 414 | { |
no test coverage detected