Fixed relative size for sphere colliders
This commit is contained in:
parent
02c79b4cc4
commit
27526dfd92
|
@ -265,9 +265,9 @@ namespace SHADE
|
|||
{
|
||||
const SHVec3& TF_WORLD_SCALE = transformComponent->GetWorldScale();
|
||||
const float MAX_SCALE = SHMath::Max({ TF_WORLD_SCALE.x, TF_WORLD_SCALE.y, TF_WORLD_SCALE.z });
|
||||
return sphere->GetRadius() / MAX_SCALE;
|
||||
return (sphere->GetRadius() / MAX_SCALE) * 2.0f;
|
||||
},
|
||||
[collider](float const& value) { collider->SetBoundingSphere(value); });
|
||||
[collider](float const& value) { collider->SetBoundingSphere(value); });
|
||||
}
|
||||
else if (collider->GetType() == SHCollider::Type::CAPSULE)
|
||||
{
|
||||
|
|
|
@ -212,7 +212,7 @@ namespace SHADE
|
|||
const SHVec3 TF_WORLD_SCALE = transformComponent->GetWorldScale();
|
||||
const float MAX_SCALE = SHMath::Max({ TF_WORLD_SCALE.x, TF_WORLD_SCALE.y, TF_WORLD_SCALE.z });
|
||||
|
||||
worldRadius *= MAX_SCALE;
|
||||
worldRadius *= MAX_SCALE * 0.5f;
|
||||
}
|
||||
|
||||
if (type == Type::SPHERE)
|
||||
|
|
Loading…
Reference in New Issue