Refactor default ContactOffset for Collider to be 2 (keep 10 for CharacterController)

#1728
This commit is contained in:
Wojtek Figat
2023-11-07 00:56:55 +01:00
parent 4fdeb773a5
commit 87a9dedba4
3 changed files with 3 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ CharacterController::CharacterController(const SpawnParams& params)
, _nonWalkableMode(NonWalkableModes::PreventClimbing)
, _lastFlags(CollisionFlags::None)
{
_contactOffset = 10.0f;
}
float CharacterController::GetRadius() const

View File

@@ -19,7 +19,7 @@ Collider::Collider(const SpawnParams& params)
, _shape(nullptr)
, _staticActor(nullptr)
, _cachedScale(1.0f)
, _contactOffset(10.0f)
, _contactOffset(2.0f)
{
Material.Changed.Bind<Collider, &Collider::OnMaterialChanged>(this);
}

View File

@@ -74,7 +74,7 @@ public:
/// <remarks>
/// Colliders whose distance is less than the sum of their ContactOffset values will generate contacts. The contact offset must be positive. Contact offset allows the collision detection system to predictively enforce the contact constraint even when the objects are slightly separated.
/// </remarks>
API_PROPERTY(Attributes="EditorOrder(1), DefaultValue(10.0f), Limit(0, 100), EditorDisplay(\"Collider\")")
API_PROPERTY(Attributes="EditorOrder(1), DefaultValue(2.0f), Limit(0, 100), EditorDisplay(\"Collider\")")
FORCE_INLINE float GetContactOffset() const
{
return _contactOffset;