// Copyright (c) 2014 Robert Rouhani and other contributors (see CONTRIBUTORS file). // Licensed under the MIT License - https://raw.github.com/Robmaister/SharpNav/master/LICENSE namespace SharpNav { /// /// Contains all the settings necessary to convert a mesh to a navmesh. /// public class NavMeshGenerationSettings { /// /// Prevents a default instance of the class from being created. /// Use instead. /// public NavMeshGenerationSettings() { //TODO now that this is public set reasonable defaults. } /// /// Gets the "default" generation settings for a model where 1 unit represents 1 meter. /// public static NavMeshGenerationSettings Default { get { //TODO rename this property to something more descriptive. var settings = new NavMeshGenerationSettings(); settings.CellSize = 0.3f; settings.CellHeight = 0.2f; settings.MaxClimb = 0.9f; settings.AgentHeight = 2.0f; settings.AgentRadius = 0.6f; settings.MinRegionSize = 8; settings.MergedRegionSize = 20; settings.MaxEdgeLength = 12; settings.MaxEdgeError = 1.8f; settings.VertsPerPoly = 6; settings.SampleDistance = 6; settings.MaxSampleError = 1; settings.BuildBoundingVolumeTree = true; return settings; } } /// /// Gets or sets the size of a cell in the X and Z axes in world units. /// public float CellSize { get; set; } /// /// Gets or sets the height of a cell in world units. /// public float CellHeight { get; set; } /// /// Gets or sets the maximum climb height. /// public float MaxClimb { get; set; } /// /// Gets or sets the height of the agents traversing the . /// public float AgentHeight { get; set; } /// /// Gets or sets the radius of the agents traversing the . /// public float AgentRadius { get; set; } /// /// Gets or sets the minimum number of spans that can form a region. Any less than this, and they will be /// merged with another region. /// public int MinRegionSize { get; set; } /// /// Gets or sets the size of the merged regions /// public int MergedRegionSize { get; set; } /// /// Gets or sets the maximum edge length allowed /// public int MaxEdgeLength { get; set; } /// /// Gets or sets the maximum error allowed /// public float MaxEdgeError { get; set; } /// /// Gets or sets the flags that determine how the is generated. /// public ContourBuildFlags ContourFlags { get; set; } /// /// Gets or sets the number of vertices a polygon can have. /// public int VertsPerPoly { get; set; } /// /// Gets or sets the sampling distance for the PolyMeshDetail /// public int SampleDistance { get; set; } /// /// Gets or sets the maximium error allowed in sampling for the PolyMeshDetail /// public int MaxSampleError { get; set; } /// /// Gets or sets a value indicating whether a bounding volume tree is generated for the mesh. /// public bool BuildBoundingVolumeTree { get; set; } /// /// Gets the height of the agents traversing the in voxel (cell) units. /// public int VoxelAgentHeight { get { return (int)(AgentHeight / CellHeight); } } /// /// Gets the maximum clim height in voxel (cell) units. /// public int VoxelMaxClimb { get { return (int)(MaxClimb / CellHeight); } } /// /// Gets the radius of the agents traversing the in voxel (cell) units. /// public int VoxelAgentRadius { get { return (int)(AgentRadius / CellHeight); } } } }