浏览代码

Merge pull request #321 from Unity-Technologies/fix_sampler_rounding_issue

Categorical parameter fix
/0.8.0.preview.4_staging
Aryan Mann 3 年前
当前提交
31aded78
共有 2 个文件被更改,包括 11 次插入3 次删除
  1. 4
      com.unity.perception/CHANGELOG.md
  2. 10
      com.unity.perception/Runtime/Randomization/Parameters/CategoricalParameter.cs

4
com.unity.perception/CHANGELOG.md


### Fixed
Fixed keypoint labeling bug when visualizations are disabled.
Fixed an issue where Simulation Delta Time values larger than 100 seconds (in Perception Camera) would cause incorrect capture scheduling behavior.
Fixed an issue where Categorical Parameters sometimes tried to fetch items at `i = categories.Count`, which caused an exception.
## [0.8.0-preview.3] - 2021-03-24
### Changed

10
com.unity.perception/Runtime/Randomization/Parameters/CategoricalParameter.cs


public T Sample()
{
var randomValue = m_Sampler.Sample();
return uniform
? m_Categories[(int)(randomValue * m_Categories.Count)]
: m_Categories[BinarySearch(randomValue)];
if (uniform)
{
var index = (int)(randomValue * m_Categories.Count);
index = index == m_Categories.Count ? index - 1 : index;
return m_Categories[index];
}
return m_Categories[BinarySearch(randomValue)];
}
/// <summary>

正在加载...
取消
保存