Fixed Camera Collision #417
|
@ -206,6 +206,16 @@ namespace SHADE
|
||||||
camera->dirtyView = true;
|
camera->dirtyView = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
camera->offset = offset;
|
||||||
|
|
||||||
|
SHVec3 tOffset = pivot.GetTargetOffset();
|
||||||
|
|
||||||
|
|
||||||
|
tOffset = SHVec3::RotateY(tOffset, SHMath::DegreesToRadians(pivot.GetYaw()));
|
||||||
|
|
||||||
|
|
||||||
|
if (pivot.lookAtCameraOrigin)
|
||||||
|
CameraLookAt(*camera, camera->position + pivot.GetTargetOffset());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -250,7 +260,7 @@ namespace SHADE
|
||||||
if (camera.isActive == false)
|
if (camera.isActive == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (SHComponentManager::HasComponent<SHTransformComponent>(camera.GetEID()) == true && &camera != &editorCamera)
|
if (SHComponentManager::HasComponent<SHTransformComponent>(camera.GetEID()) == true && SHComponentManager::HasComponent<SHCameraArmComponent>(camera.GetEID()) == false && &camera != &editorCamera)
|
||||||
{
|
{
|
||||||
auto transform = SHComponentManager::GetComponent<SHTransformComponent>(camera.GetEID());
|
auto transform = SHComponentManager::GetComponent<SHTransformComponent>(camera.GetEID());
|
||||||
SHVec3 rotation = transform->GetWorldRotation();
|
SHVec3 rotation = transform->GetWorldRotation();
|
||||||
|
@ -273,14 +283,14 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
camera.offset = arm->GetOffset();
|
camera.offset = arm->GetOffset();
|
||||||
|
|
||||||
SHVec3 tOffset = arm->GetTargetOffset();
|
/*SHVec3 tOffset = arm->GetTargetOffset();
|
||||||
|
|
||||||
|
|
||||||
tOffset = SHVec3::RotateY(tOffset, SHMath::DegreesToRadians(arm->GetYaw()));
|
tOffset = SHVec3::RotateY(tOffset, SHMath::DegreesToRadians(arm->GetYaw()));
|
||||||
|
|
||||||
|
|
||||||
if (arm->lookAtCameraOrigin)
|
if (arm->lookAtCameraOrigin)
|
||||||
CameraLookAt(camera, camera.position + tOffset);
|
CameraLookAt(camera, camera.position + arm->GetTargetOffset());*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue