浏览代码

added explicit check for zero valued random state

/main
Steven Leal 4 年前
当前提交
52f51eec
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 5
      com.unity.perception/Runtime/Randomization/Samplers/SamplerUtility.cs

5
com.unity.perception/Runtime/Randomization/Samplers/SamplerUtility.cs


}
/// <summary>
/// Generates new a new random state by deterministically hashing a base seed with an iteration index
/// Generates new a new non-zero random state by deterministically hashing a base seed with an iteration index
/// </summary>
/// <param name="index">Usually the current scenario iteration or framesSinceInitialization</param>
/// <param name="baseSeed">The seed to be offset</param>

{
return (uint)Hash64(((ulong)index << 32) | baseSeed) | 1u;
var state = (uint)Hash64(((ulong)index << 32) | baseSeed);
return state == 0u ? largePrime : state;
}
/// <summary>

正在加载...
取消
保存