Fix missing CharacterController bounds if controller is missing
This commit is contained in:
@@ -283,11 +283,10 @@ Viewport SceneRenderTask::GetViewport() const
|
|||||||
|
|
||||||
GPUTextureView* SceneRenderTask::GetOutputView() const
|
GPUTextureView* SceneRenderTask::GetOutputView() const
|
||||||
{
|
{
|
||||||
if (Output)
|
if (Output && Output->IsAllocated())
|
||||||
return Output->View();
|
return Output->View();
|
||||||
if (SwapChain)
|
if (SwapChain)
|
||||||
return SwapChain->GetBackBufferView();
|
return SwapChain->GetBackBufferView();
|
||||||
CRASH;
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -361,6 +361,11 @@ void CharacterController::OnTransformChanged()
|
|||||||
UpdateScale();
|
UpdateScale();
|
||||||
UpdateBounds();
|
UpdateBounds();
|
||||||
}
|
}
|
||||||
|
else if (!_controller)
|
||||||
|
{
|
||||||
|
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
||||||
|
BoundingSphere::FromBox(_box, _sphere);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterController::Serialize(SerializeStream& stream, const void* otherObj)
|
void CharacterController::Serialize(SerializeStream& stream, const void* otherObj)
|
||||||
|
|||||||
Reference in New Issue
Block a user