// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/VisualSystem.cpp
// Function: VisualSystem::DoVisualExecute()
void VisualSystem::DoVisualExecute() {
  mBestVisualAction.mDir = GetNormalizeAngleDeg(mBestVisualAction.mDir);

  AngleDeg finalnec = GetNormalizeAngleDeg(
      mBestVisualAction.mDir -
      mPreBodyDir); //最后要看的方向与当前（或者说执行过本周期动作后，如turn）身体正对方向的夹角，即最后的neckrelangle。

  if (fabs(finalnec) > ServerParam::instance().maxNeckAngle()) {
    if (mCanTurn) {
      if (finalnec < 0.0) {
        mpAgent->Turn(finalnec - ServerParam::instance().minNeckAngle());
        mpAgent->TurnNeck(ServerParam::instance().minNeckMoment());
      } else {
        mpAgent->Turn(finalnec - ServerParam::instance().maxNeckAngle());
        mpAgent->TurnNeck(ServerParam::instance().maxNeckMoment());
      }
    } else {
      if (finalnec < 0.0) {
        mpAgent->TurnNeck(ServerParam::instance().minNeckMoment());
      } else {
        mpAgent->TurnNeck(ServerParam::instance().maxNeckMoment());
      }
    }
  } else {
    finalnec -= mpSelfState->GetNeckDir();
    mpAgent->TurnNeck(finalnec);
  }

  if (mViewWidth != mpSelfState->GetViewWidth()) {
    mpAgent->ChangeView(mViewWidth);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movsd 0x670(%rax), %xmm0
movsd 0x18c19(%rip), %xmm1    # 0xc1030
movsd %xmm1, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x116b0
movq -0x30(%rbp), %rax
movsd %xmm0, 0x670(%rax)
movsd 0x670(%rax), %xmm0
subsd 0x648(%rax), %xmm0
movsd 0x18be7(%rip), %xmm1    # 0xc1030
movsd %xmm1, -0x20(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x116b0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movaps 0x18bf8(%rip), %xmm1    # 0xc1060
pand %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x13020
movsd -0x28(%rbp), %xmm0
ucomisd (%rax), %xmm0
jbe 0xa85be
movq -0x30(%rbp), %rax
testb $0x1, 0x63c(%rax)
je 0xa8562
xorps %xmm0, %xmm0
ucomisd -0x18(%rbp), %xmm0
jbe 0xa8505
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x13000
movsd -0x48(%rbp), %xmm0
movq -0x40(%rbp), %rdi
subsd (%rax), %xmm0
callq 0x10430
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x10da0
movq -0x38(%rbp), %rdi
movsd (%rax), %xmm0
callq 0xa9480
jmp 0xa8560
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x13020
movsd -0x60(%rbp), %xmm0
movq -0x58(%rbp), %rdi
subsd (%rax), %xmm0
callq 0x10430
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x10dc0
movq -0x50(%rbp), %rdi
movsd (%rax), %xmm0
callq 0xa9480
jmp 0xa85bc
xorps %xmm0, %xmm0
ucomisd -0x18(%rbp), %xmm0
jbe 0xa8594
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x10da0
movq -0x68(%rbp), %rdi
movsd (%rax), %xmm0
callq 0xa9480
jmp 0xa85ba
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x70(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x10dc0
movq -0x70(%rbp), %rdi
movsd (%rax), %xmm0
callq 0xa9480
jmp 0xa85bc
jmp 0xa85ee
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x118d0
movq -0x30(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x18(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movq 0x8(%rax), %rdi
movsd -0x18(%rbp), %xmm0
callq 0xa9480
movq -0x30(%rbp), %rax
movl 0x640(%rax), %ecx
movl %ecx, -0x74(%rbp)
movq 0x20(%rax), %rdi
callq 0x11070
movl %eax, %ecx
movl -0x74(%rbp), %eax
cmpl %ecx, %eax
je 0xa8620
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movl 0x640(%rax), %esi
callq 0xa94b0
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)