Fixed relative size for sphere colliders
This commit is contained in:
parent
02c79b4cc4
commit
27526dfd92
|
@ -265,7 +265,7 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
const SHVec3& TF_WORLD_SCALE = transformComponent->GetWorldScale();
|
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 });
|
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); });
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,7 +212,7 @@ namespace SHADE
|
||||||
const SHVec3 TF_WORLD_SCALE = transformComponent->GetWorldScale();
|
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 });
|
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)
|
if (type == Type::SPHERE)
|
||||||
|
|
Loading…
Reference in New Issue