Merge branch 'development' into cmake/SPEC-2513_w4018
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> # Conflicts: # Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp
This commit is contained in:
@@ -618,12 +618,6 @@ ILevel* CLevelSystem::LoadLevelInternal(const char* _levelName)
|
||||
}
|
||||
}
|
||||
|
||||
// Reset the camera to (1,1,1) (not (0,0,0) which is the invalid/uninitialised state,
|
||||
// to avoid the hack in the renderer to not show anything if the camera is at the origin).
|
||||
CCamera defaultCam;
|
||||
defaultCam.SetPosition(Vec3(1.0f));
|
||||
m_pSystem->SetViewCamera(defaultCam);
|
||||
|
||||
m_pLoadingLevelInfo = pLevelInfo;
|
||||
OnLoadingStart(levelName);
|
||||
|
||||
@@ -952,10 +946,6 @@ void CLevelSystem::UnloadLevel()
|
||||
oAudioRequestData.pData = &oAMData3;
|
||||
Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequestBlocking, oAudioRequestData);
|
||||
|
||||
// Reset the camera to (0,0,0) which is the invalid/uninitialised state
|
||||
CCamera defaultCam;
|
||||
m_pSystem->SetViewCamera(defaultCam);
|
||||
|
||||
OnUnloadComplete(m_lastLevelName.c_str());
|
||||
|
||||
// -- kenzo: this will close all pack files for this level
|
||||
|
||||
@@ -268,12 +268,6 @@ namespace LegacyLevelSystem
|
||||
// This is a workaround until the replacement for GameEntityContext is done
|
||||
AzFramework::GameEntityContextEventBus::Broadcast(&AzFramework::GameEntityContextEventBus::Events::OnPreGameEntitiesStarted);
|
||||
|
||||
// Reset the camera to (1,1,1) (not (0,0,0) which is the invalid/uninitialised state,
|
||||
// to avoid the hack in the renderer to not show anything if the camera is at the origin).
|
||||
CCamera defaultCam;
|
||||
defaultCam.SetPosition(Vec3(1.0f));
|
||||
m_pSystem->SetViewCamera(defaultCam);
|
||||
|
||||
OnLoadingStart(levelName);
|
||||
|
||||
auto pPak = gEnv->pCryPak;
|
||||
@@ -587,10 +581,6 @@ namespace LegacyLevelSystem
|
||||
oAudioRequestData.pData = &oAMData3;
|
||||
Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequestBlocking, oAudioRequestData);
|
||||
|
||||
// Reset the camera to (0,0,0) which is the invalid/uninitialised state
|
||||
CCamera defaultCam;
|
||||
m_pSystem->SetViewCamera(defaultCam);
|
||||
|
||||
OnUnloadComplete(m_lastLevelName.c_str());
|
||||
|
||||
AzFramework::RootSpawnableInterface::Get()->ReleaseRootSpawnable();
|
||||
|
||||
@@ -353,9 +353,6 @@ public:
|
||||
virtual IXmlUtils* GetXmlUtils();
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void SetViewCamera(CCamera& Camera){ m_ViewCamera = Camera; }
|
||||
CCamera& GetViewCamera() { return m_ViewCamera; }
|
||||
|
||||
void IgnoreUpdates(bool bIgnore) { m_bIgnoreUpdates = bIgnore; };
|
||||
|
||||
void SetIProcess(IProcess* process);
|
||||
@@ -494,7 +491,6 @@ private: // ------------------------------------------------------
|
||||
SSystemGlobalEnvironment m_env;
|
||||
|
||||
CTimer m_Time; //!<
|
||||
CCamera m_ViewCamera; //!<
|
||||
bool m_bInitializedSuccessfully; //!< true if the system completed all initialization steps
|
||||
bool m_bRelaunch; //!< relaunching the app or not (true beforerelaunch)
|
||||
int m_iLoadingMode; //!< Game is loading w/o changing context (0 not, 1 quickloading, 2 full loading)
|
||||
|
||||
@@ -896,16 +896,14 @@ void CSystem::InitLocalization()
|
||||
if (auto console = AZ::Interface<AZ::IConsole>::Get(); console != nullptr)
|
||||
{
|
||||
AZ::CVarFixedString languageAudio;
|
||||
if (auto result = console->GetCvarValue("g_languageAudio", languageAudio); result == AZ::GetValueResult::Success)
|
||||
console->GetCvarValue("g_languageAudio", languageAudio);
|
||||
if (languageAudio.empty())
|
||||
{
|
||||
if (languageAudio.size() == 0)
|
||||
{
|
||||
console->PerformCommand(AZStd::string::format("g_languageAudio %s", language.c_str()).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
language.assign(languageAudio.data(), languageAudio.size());
|
||||
}
|
||||
console->PerformCommand(AZStd::string::format("g_languageAudio %s", language.c_str()).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
language.assign(languageAudio.data(), languageAudio.size());
|
||||
}
|
||||
}
|
||||
OpenLanguageAudioPak(language);
|
||||
|
||||
@@ -58,10 +58,10 @@ DebugCamera::~DebugCamera()
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void DebugCamera::OnEnable()
|
||||
{
|
||||
m_position = gEnv->pSystem->GetViewCamera().GetPosition();
|
||||
m_position = Vec3_Zero;
|
||||
m_moveInput = Vec3_Zero;
|
||||
|
||||
Ang3 cameraAngles = Ang3(gEnv->pSystem->GetViewCamera().GetMatrix());
|
||||
Ang3 cameraAngles = Ang3(ZERO);
|
||||
m_cameraYaw = RAD2DEG(cameraAngles.z);
|
||||
m_cameraPitch = RAD2DEG(cameraAngles.x);
|
||||
m_view = Matrix33(Ang3(DEG2RAD(m_cameraPitch), 0.0f, DEG2RAD(m_cameraYaw)));
|
||||
@@ -126,13 +126,6 @@ void DebugCamera::Update()
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void DebugCamera::PostUpdate()
|
||||
{
|
||||
if (m_cameraMode == DebugCamera::ModeOff)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CCamera& camera = gEnv->pSystem->GetViewCamera();
|
||||
camera.SetMatrix(Matrix34(m_view, m_position));
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -55,79 +55,9 @@ void CView::Release()
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void CView::Update(float frameTime, bool isActive)
|
||||
void CView::Update([[maybe_unused]] float frameTime, [[maybe_unused]] bool isActive)
|
||||
{
|
||||
//FIXME:some cameras may need to be updated always
|
||||
if (!isActive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_azEntity)
|
||||
{
|
||||
m_viewParams.SaveLast();
|
||||
|
||||
CCamera* pSysCam = &m_pSystem->GetViewCamera();
|
||||
|
||||
//process screen shaking
|
||||
ProcessShaking(frameTime);
|
||||
|
||||
//FIXME:to let the updateView implementation use the correct shakeVector
|
||||
m_viewParams.currentShakeShift = m_viewParams.rotation * m_viewParams.currentShakeShift;
|
||||
|
||||
m_viewParams.frameTime = frameTime;
|
||||
//update view position/rotation
|
||||
if (m_azEntity != nullptr)
|
||||
{
|
||||
auto entityTransform = m_azEntity->GetTransform();
|
||||
if (entityTransform != nullptr)
|
||||
{
|
||||
AZ::Transform transform = entityTransform->GetWorldTM();
|
||||
m_viewParams.position = AZVec3ToLYVec3(transform.GetTranslation());
|
||||
m_viewParams.rotation = AZQuaternionToLYQuaternion(transform.GetRotation());
|
||||
}
|
||||
}
|
||||
|
||||
ApplyFrameAdditiveAngles(m_viewParams.rotation);
|
||||
|
||||
const float fNearZ = gEnv->pSystem->GetIViewSystem()->GetDefaultZNear();
|
||||
|
||||
//see if the view have to use a custom near clipping plane
|
||||
const float nearPlane = (m_viewParams.nearplane >= CAMERA_MIN_NEAR) ? (m_viewParams.nearplane) : fNearZ;
|
||||
const float farPlane = (m_viewParams.farplane > 0.f) ? m_viewParams.farplane : DEFAULT_FAR;
|
||||
float fov = (m_viewParams.fov < 0.001f) ? DEFAULT_FOV : m_viewParams.fov;
|
||||
|
||||
m_camera.SetFrustum(pSysCam->GetViewSurfaceX(), pSysCam->GetViewSurfaceZ(), fov, nearPlane, farPlane, pSysCam->GetPixelAspectRatio());
|
||||
|
||||
//apply shake & set the view matrix
|
||||
m_viewParams.rotation *= m_viewParams.currentShakeQuat;
|
||||
m_viewParams.rotation.NormalizeSafe();
|
||||
m_viewParams.position += m_viewParams.currentShakeShift;
|
||||
|
||||
// Blending between cameras needs to happen after Camera space rendering calculations have been applied
|
||||
// so that the m_viewParams.position is in World Space again
|
||||
m_viewParams.UpdateBlending(frameTime);
|
||||
|
||||
// [VR] specific
|
||||
// Add HMD's pose tracking on top of current camera pose
|
||||
// Each game-title can decide whether to keep this functionality here or (most likely)
|
||||
// move it somewhere else.
|
||||
|
||||
Quat q = m_viewParams.rotation;
|
||||
Vec3 pos = m_viewParams.position;
|
||||
Vec3 p = Vec3(ZERO);
|
||||
|
||||
Matrix34 viewMtx(q);
|
||||
viewMtx.SetTranslation(pos + p);
|
||||
m_camera.SetMatrix(viewMtx);
|
||||
|
||||
m_camera.SetEntityRotation(m_viewParams.rotation);
|
||||
m_camera.SetEntityPos(pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_linkedTo = AZ::EntityId(0);
|
||||
}
|
||||
AZ_ErrorOnce("CryLegacy", false, "CryLegacy view system no longer available (CView::Update)");
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
@@ -253,7 +253,7 @@ void CViewSystem::Update(float frameTime)
|
||||
}
|
||||
}
|
||||
|
||||
m_pSystem->SetViewCamera(rCamera);
|
||||
AZ_ErrorOnce("CryLegacy", false, "CryLegacy view system no longer available (CViewSystem::Update)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,23 +557,7 @@ void CViewSystem::SetOverrideCameraRotation(bool bOverride, Quat rotation)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CViewSystem::UpdateSoundListeners()
|
||||
{
|
||||
assert(gEnv->IsEditor() && !gEnv->IsEditorGameMode());
|
||||
|
||||
// In Editor we may want to control global listeners outside of the game view.
|
||||
if (m_bControlsAudioListeners)
|
||||
{
|
||||
IView* const pActiveView = static_cast<IView*>(GetActiveView());
|
||||
TViewMap::const_iterator Iter(m_views.begin());
|
||||
TViewMap::const_iterator const IterEnd(m_views.end());
|
||||
|
||||
for (; Iter != IterEnd; ++Iter)
|
||||
{
|
||||
IView* const pView = Iter->second;
|
||||
bool const bIsActive = (pView == pActiveView);
|
||||
CCamera const& rCamera = bIsActive ? gEnv->pSystem->GetViewCamera() : pView->GetCamera();
|
||||
pView->UpdateAudioListener(rCamera.GetMatrix());
|
||||
}
|
||||
}
|
||||
AZ_ErrorOnce("CryLegacy", false, "CryLegacy view system no longer available (CViewSystem::UpdateSoundListeners)");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user