Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Cylinder bevel radius cannot be larger than the cylinder

Discussion in 'Physics for ECS' started by florianhanke, Jan 14, 2020.

  1. florianhanke

    florianhanke

    Joined:
    Jun 8, 2018
    Posts:
    426
    On relatively thin cylinders (radius ~3mm-1cm, 1m = 1unit), when I add a Cylinder PhysicsShape, and Fit To Enabled Render Meshes, then the following is thrown:

    Code (CSharp):
    1. ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    2. Parameter name: Cylinder bevel radius cannot be larger than the cylinder
    3. Unity.Physics.CylinderGeometry.Validate () (at Library/PackageCache/com.unity.physics@0.2.5-preview.1/Unity.Physics/Collision/Colliders/CylinderCollider.cs:85)
    Here:

    Code (CSharp):
    1.             if (m_BevelRadius > m_Radius || m_BevelRadius * 2 > m_Height)
    2.             {
    3.                 throw new ArgumentOutOfRangeException("Cylinder bevel radius cannot be larger than the cylinder");
    4.             }
    "Fit To Enabled Render Meshes" should probably not generate `ArgumentOutOfRangeException`, which is why I think this is a bug. It should probably generate a bevel radius that does not violate `m_BevelRadius > m_Radius || m_BevelRadius * 2 > m_Height`, and if not useful, emit a warning.
     
    Last edited: Jan 14, 2020
  2. Adam-Mechtley

    Adam-Mechtley

    Administrator

    Joined:
    Feb 5, 2007
    Posts:
    290
    Thanks for posting, we'll get it fixed
     
    florianhanke likes this.
  3. florianhanke

    florianhanke

    Joined:
    Jun 8, 2018
    Posts:
    426
    Thank you! :)