public void GetCapsuleProperties_WhenShapeIsBox_RadiusIsHalfSecondMaxDimension( [Values(0f, 1f, 2f, 3f)] float sizeX, [Values(0f, 1f, 2f, 3f)] float sizeY, [Values(0f, 1f, 2f, 3f)] float sizeZ ) { var size = new float3(sizeX, sizeY, sizeZ); m_Shape.SetBox(0f, size, quaternion.identity); m_Shape.GetCapsuleProperties(out var center, out var height, out var radius, out quaternion orientation); var cmaxI = size.GetMaxAxis(); var expectedRadius = 0.5f * math.cmax(cmaxI == 0 ? size.yz : cmaxI == 1 ? size.xz : size.xy); Assert.That(radius, Is.EqualTo(expectedRadius)); }
public void GetCapsuleProperties_WhenShapeIsBox_RadiusIsHalfSecondMaxDimension( [Values(0f, 1f, 2f, 3f)] float sizeX, [Values(0f, 1f, 2f, 3f)] float sizeY, [Values(0f, 1f, 2f, 3f)] float sizeZ ) { var size = new float3(sizeX, sizeY, sizeZ); m_Shape.SetBox(new BoxGeometry { Size = size, Orientation = quaternion.identity }); var capsule = m_Shape.GetCapsuleProperties(out quaternion _); var cmaxI = size.GetMaxAxis(); var expectedRadius = 0.5f * math.cmax(cmaxI == 0 ? size.yz : cmaxI == 1 ? size.xz : size.xy); Assert.That(capsule.Radius, Is.EqualTo(expectedRadius)); }