docs.unity3d.com
    显示 / 隐藏目录

    Class PlaneVoxelGrid<TLayerPlane>

    A grid of voxels that is used to find planes of a specific orientation. Planes can be found in each individual layer of the grid based on the density of points in each voxel.

    Inheritance
    Object
    PlaneVoxelGrid<TLayerPlane>
    PlaneDiscoveryVoxelGrid
    PlaneExtractionVoxelGrid
    Namespace: Unity.MARS
    Syntax
    public abstract class PlaneVoxelGrid<TLayerPlane>
        where TLayerPlane : LayerPlaneData
    Type Parameters
    Name Description
    TLayerPlane

    Constructors

    PlaneVoxelGrid(VoxelGridOrientation, Bounds, Single, VoxelPlaneFindingParams)

    Constructs an oriented voxel grid of a given size

    Declaration
    protected PlaneVoxelGrid(VoxelGridOrientation orientation, Bounds containedBounds, float voxelSize, VoxelPlaneFindingParams planeFindingParams)
    Parameters
    Type Name Description
    VoxelGridOrientation orientation

    Determines how the grid is divided into layers from which planes can be found

    Bounds containedBounds

    The grid will be just large enough to contain these bounds

    Single voxelSize

    Side length of each voxel

    VoxelPlaneFindingParams planeFindingParams

    Parameters used to find planes

    Fields

    k_PlaneYEpsilon

    A small local y offset applied to a plane to avoid z-fighting with the mesh it was extracted from

    Declaration
    protected const float k_PlaneYEpsilon = 0.001F
    Field Value
    Type Description
    Single

    k_Up

    Declaration
    protected static readonly Vector3 k_Up
    Field Value
    Type Description
    Vector3

    m_Layers

    Declaration
    protected readonly int m_Layers
    Field Value
    Type Description
    Int32

    m_MinSideLength

    Declaration
    protected readonly float m_MinSideLength
    Field Value
    Type Description
    Single

    m_ModifiedPlanesPerLayer

    Declaration
    protected readonly List<List<TLayerPlane>> m_ModifiedPlanesPerLayer
    Field Value
    Type Description
    List<List<TLayerPlane>>

    m_PlanesPerLayer

    Declaration
    protected readonly List<List<TLayerPlane>> m_PlanesPerLayer
    Field Value
    Type Description
    List<List<TLayerPlane>>

    m_RemovedPlanesPerLayer

    Declaration
    protected readonly List<List<TLayerPlane>> m_RemovedPlanesPerLayer
    Field Value
    Type Description
    List<List<TLayerPlane>>

    m_UpdatedVoxelsPerLayer

    Declaration
    protected readonly List<HashSet<Vector2Int>> m_UpdatedVoxelsPerLayer
    Field Value
    Type Description
    List<HashSet<Vector2Int>>

    m_VoxelSize

    Declaration
    protected readonly float m_VoxelSize
    Field Value
    Type Description
    Single

    Properties

    CheckEmptyAreaForInitialPlanes

    Declaration
    protected abstract bool CheckEmptyAreaForInitialPlanes { get; }
    Property Value
    Type Description
    Boolean

    Methods

    AddPoints(List<Vector3>)

    Declaration
    public void AddPoints(List<Vector3> points)
    Parameters
    Type Name Description
    List<Vector3> points

    CreateLayerPlane(PlaneVoxel)

    Declaration
    protected abstract TLayerPlane CreateLayerPlane(PlaneVoxel startingVoxel)
    Parameters
    Type Name Description
    PlaneVoxel startingVoxel
    Returns
    Type Description
    TLayerPlane

    FindPlanes()

    Declaration
    protected void FindPlanes()

    GetLayerOriginPose(Int32)

    Declaration
    protected Pose GetLayerOriginPose(int layerIndex)
    Parameters
    Type Name Description
    Int32 layerIndex
    Returns
    Type Description
    Pose

    GetVoxel(Int32, Int32, Int32)

    Declaration
    protected PlaneVoxel GetVoxel(int layer, int column, int row)
    Parameters
    Type Name Description
    Int32 layer
    Int32 column
    Int32 row
    Returns
    Type Description
    PlaneVoxel

    GetVoxel(Vector3Int)

    Declaration
    protected PlaneVoxel GetVoxel(Vector3Int coordinates)
    Parameters
    Type Name Description
    Vector3Int coordinates
    Returns
    Type Description
    PlaneVoxel

    TryGetPlaneData(LayerPlaneData, Pose, List<Vector3>, out Pose, out Vector3, out Vector2)

    Declaration
    protected bool TryGetPlaneData(LayerPlaneData layerPlane, Pose layerOriginPose, List<Vector3> vertices, out Pose pose, out Vector3 center, out Vector2 extents)
    Parameters
    Type Name Description
    LayerPlaneData layerPlane
    Pose layerOriginPose
    List<Vector3> vertices
    Pose pose
    Vector3 center
    Vector2 extents
    Returns
    Type Description
    Boolean

    TryMergePlanes(TLayerPlane, TLayerPlane, Single, Single)

    Declaration
    protected virtual bool TryMergePlanes(TLayerPlane planeA, TLayerPlane planeB, float planeAHeight, float planeBHeight)
    Parameters
    Type Name Description
    TLayerPlane planeA
    TLayerPlane planeB
    Single planeAHeight
    Single planeBHeight
    Returns
    Type Description
    Boolean
    返回到顶部
    Copyright © 2023 Unity Technologies — 商标和使用条款
    • 法律条款
    • 隐私政策
    • Cookie
    • 不要出售或分享我的个人信息
    • Your Privacy Choices (Cookie Settings)