TVector CCharacterCamera::GetThirdPersonCameraDirection() { CCharacter* pCharacter = m_hCharacter; if (!pCharacter) return TVector(); return AngleVector(pCharacter->GetThirdPersonCameraAngles()); }
TVector CCharacterCamera::GetThirdPersonCameraPosition() { CCharacter* pCharacter = m_hCharacter; if (!pCharacter) return TVector(10, 0, 0); TVector vecEyeHeight = pCharacter->GetUpVector() * pCharacter->EyeHeight(); TMatrix mView = TMatrix(pCharacter->GetThirdPersonCameraAngles(), TVector()); TVector vecThird = pCharacter->GetGlobalTransform().GetTranslation() + vecEyeHeight; vecThird -= Vector(mView.GetForwardVector()) * m_flBack; vecThird += Vector(mView.GetUpVector()) * m_flUp; vecThird += Vector(mView.GetLeftVector()) * m_flSide; return vecThird; }