浏览代码

fixed GenerateRandomSeedFromIndex method

/main
Steven Leal 4 年前
当前提交
f183da3f
共有 3 个文件被更改,包括 9 次插入5 次删除
  1. 2
      com.unity.perception/CHANGELOG.md
  2. 2
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/BackgroundObjectPlacementRandomizer.cs
  3. 10
      com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs

2
com.unity.perception/CHANGELOG.md


Fixed enumeration in the CategoricalParameter.categories property
The GenerateRandomSeedFromIndex method now correctly hashes the current scenario iteration into the random seed it generates
## [0.5.0-preview.1] - 2020-10-14
### Known Issues

2
com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/BackgroundObjectPlacementRandomizer.cs


for (var i = 0; i < layerCount; i++)
{
var seed = scenario.GenerateIterativeRandomSeed(i);
var seed = scenario.GenerateRandomSeedFromIndex(i);
var placementSamples = PoissonDiskSampling.GenerateSamples(
placementArea.x, placementArea.y, separationDistance, seed);
var offset = new Vector3(placementArea.x, placementArea.y, 0f) * -0.5f;

10
com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs


}
/// <summary>
/// Generates a random seed by hashing three values together: an arbitrary iteration value,
/// the current scenario iteration, and a base random seed
/// Generates a random seed by hashing three values together: an arbitrary index value,
/// the current scenario iteration, and a base random seed. This method is useful for deterministically
/// generating random seeds from within a for-loop.
public uint GenerateIterativeRandomSeed(int iteration, uint baseSeed = SamplerUtility.largePrime)
public uint GenerateRandomSeedFromIndex(int iteration, uint baseSeed = SamplerUtility.largePrime)
return SamplerUtility.IterateSeed((uint)iteration, baseSeed);
var seed = SamplerUtility.IterateSeed((uint)iteration, baseSeed);
return SamplerUtility.IterateSeed((uint)currentIteration, seed);
}
void ValidateParameters()

正在加载...
取消
保存