浏览代码

added xml docs to sample randomizers

/main
Steven Leal 4 年前
当前提交
43f2de18
共有 9 个文件被更改,包括 100 次插入4 次删除
  1. 31
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/BackgroundObjectPlacementRandomizer.cs
  2. 10
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/ColorRandomizer.cs
  3. 27
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/ForegroundObjectPlacementRandomizer.cs
  4. 9
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/RotationRandomizer.cs
  5. 10
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/TextureRandomizer.cs
  6. 3
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/ColorRandomizerTag.cs
  7. 3
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/RotationRandomizerTag.cs
  8. 3
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/TextureRandomizerTag.cs
  9. 8
      com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Utilities/PoissonDiskSampling.cs

31
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/BackgroundObjectPlacementRandomizer.cs


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Creates multiple layers of evenly distributed but randomly placed objects
/// </summary>
List<GameObject> m_SpawnedObjects = new List<GameObject>();
/// <summary>
/// The Z offset component applied to all generated background layers
/// </summary>
/// <summary>
/// The number of background layers to generate
/// </summary>
/// <summary>
/// The minimum distance between placed background objects
/// </summary>
/// <summary>
/// The 2D size of the generated background layers
/// </summary>
/// <summary>
/// A categorical parameter for sampling random prefabs to place
/// </summary>
List<GameObject> m_SpawnedObjects = new List<GameObject>();
/// <summary>
/// Generates background layers of objects at the start of each scenario iteration
/// </summary>
protected override void OnIterationStart()
{
for (var i = 0; i < layerCount; i++)

}
}
/// <summary>
/// Deletes generated background objects after each scenario iteration is complete
/// </summary>
protected override void OnIterationEnd()
{
foreach (var spawnedObject in m_SpawnedObjects)

10
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/ColorRandomizer.cs


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Randomizes the material color of objects tagged with a ColorRandomizerTag
/// </summary>
/// <summary>
/// Describes the range of random colors to assign to tagged objects
/// </summary>
/// <summary>
/// Randomizes the colors of tagged objects at the start of each scenario iteration
/// </summary>
protected override void OnIterationStart()
{
var taggedObjects = tagManager.Query<ColorRandomizerTag>();

27
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/ForegroundObjectPlacementRandomizer.cs


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Creates a 2D layer of of evenly spaced GameObjects from a given list of prefabs
/// </summary>
List<GameObject> m_SpawnedObjects = new List<GameObject>();
/// <summary>
/// The Z offset component applied to the generated layer of GameObjects
/// </summary>
/// <summary>
/// The minimum distance between all placed objects
/// </summary>
/// <summary>
/// The size of the 2D area designated for object placement
/// </summary>
/// <summary>
/// The list of prefabs sample and randomly place
/// </summary>
List<GameObject> m_SpawnedObjects = new List<GameObject>();
/// <summary>
/// Generates a foreground layer of objects at the start of each scenario iteration
/// </summary>
protected override void OnIterationStart()
{
var seed = SamplerUtility.IterateSeed((uint)scenario.currentIteration, SamplerUtility.largePrime);

placementSamples.Dispose();
}
/// <summary>
/// Deletes generated foreground objects after each scenario iteration is complete
/// </summary>
protected override void OnIterationEnd()
{
foreach (var spawnedObject in m_SpawnedObjects)

9
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/RotationRandomizer.cs


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Randomizes the rotation of objects tagged with a RotationRandomizerTag
/// </summary>
/// <summary>
/// Defines the range of random rotations that can be assigned to tagged objects
/// </summary>
/// <summary>
/// Randomizes the rotation of tagged objects at the start of each scenario iteration
/// </summary>
protected override void OnIterationStart()
{
var taggedObjects = tagManager.Query<RotationRandomizerTag>();

10
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Randomizers/TextureRandomizer.cs


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Randomizes the material texture of objects tagged with a TextureRandomizerTag
/// </summary>
/// <summary>
/// The list of textures to sample and apply to tagged objects
/// </summary>
/// <summary>
/// Randomizes the material texture of tagged objects at the start of each scenario iteration
/// </summary>
protected override void OnIterationStart()
{
var taggedObjects = tagManager.Query<TextureRandomizerTag>();

3
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/ColorRandomizerTag.cs


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags
{
/// <summary>
/// Used in conjunction with a ColorRandomizer to vary the material color of GameObjects
/// </summary>
[AddComponentMenu("Perception/RandomizerTags/ColorRandomizerTag")]
public class ColorRandomizerTag : RandomizerTag { }
}

3
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/RotationRandomizerTag.cs


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags
{
/// <summary>
/// Used in conjunction with a RotationRandomizer to vary the rotation of GameObjects
/// </summary>
[AddComponentMenu("Perception/RandomizerTags/RotationRandomizerTag")]
public class RotationRandomizerTag : RandomizerTag { }
}

3
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Tags/TextureRandomizerTag.cs


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags
{
/// <summary>
/// Used in conjunction with a TextureRandomizer to vary the material texture of GameObjects
/// </summary>
[AddComponentMenu("Perception/RandomizerTags/TextureRandomizerTag")]
public class TextureRandomizerTag : RandomizerTag { }
}

8
com.unity.perception/Runtime/Randomization/Randomizers/SampleRandomizers/Utilities/PoissonDiskSampling.cs


namespace UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers
{
/// <summary>
/// Utility for generating lists of poisson disk sampled points
/// </summary>
public static class PoissonDiskSampling
{
const int k_DefaultSamplingResolution = 30;

/// <summary>
/// <para>Returns a list of poisson disc sampled points for a given area and density</para>
/// Returns a list of poisson disc sampled points for a given area and density
/// </summary>
/// <param name="width">Width of the sampling area</param>
/// <param name="height">Height of the sampling area</param>

/// <returns>The list of generated poisson points</returns>
public static NativeList<float2> GenerateSamples(
float width,
float height,

}
}
public static NativeList<float2> Sample(
static NativeList<float2> Sample(
float width,
float height,
float minimumRadius,

正在加载...
取消
保存