Fix for #1365
This commit is contained in:
@@ -245,12 +245,10 @@ void CharacterController::CreateShape()
|
|||||||
|
|
||||||
void CharacterController::UpdateBounds()
|
void CharacterController::UpdateBounds()
|
||||||
{
|
{
|
||||||
void* actor = _shape ? PhysicsBackend::GetShapeActor(_shape) : nullptr;
|
const float radius = Math::Max(_height, _radius);
|
||||||
if (actor)
|
const Vector3 position = _transform.LocalToWorld(_center);
|
||||||
PhysicsBackend::GetActorBounds(actor, _box);
|
_sphere = BoundingSphere(position, radius);
|
||||||
else
|
_box = BoundingBox::FromSphere(_sphere);
|
||||||
_box = BoundingBox(_transform.Translation);
|
|
||||||
BoundingSphere::FromBox(_box, _sphere);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterController::AddMovement(const Vector3& translation, const Quaternion& rotation)
|
void CharacterController::AddMovement(const Vector3& translation, const Quaternion& rotation)
|
||||||
|
|||||||
Reference in New Issue
Block a user