/// <inheritdoc/>
        public PlaneDiscoveryVoxelGrid(
            VoxelGridOrientation orientation, Bounds containedBounds, float voxelSize, VoxelPlaneFindingParams planeFindingParams)
            : base(orientation, containedBounds, voxelSize, planeFindingParams)
        {
            m_PlaneAlignment = orientation == VoxelGridOrientation.Up ? MarsPlaneAlignment.HorizontalUp : orientation == VoxelGridOrientation.Down ?
                               MarsPlaneAlignment.HorizontalDown : MarsPlaneAlignment.Vertical;

            m_DebugVoxelSize        = Vector3.one * (voxelSize - k_DebugVoxelMargin * 2f);
            m_DebugVoxelYOffsetSize = m_DebugVoxelSize;
            switch (orientation)
            {
            case VoxelGridOrientation.Up:
            case VoxelGridOrientation.Down:
                m_DebugVoxelYOffsetSize.y = k_DebugYOffsetCubeThickness;
                break;

            case VoxelGridOrientation.Forward:
            case VoxelGridOrientation.Back:
                m_DebugVoxelYOffsetSize.z = k_DebugYOffsetCubeThickness;
                break;

            case VoxelGridOrientation.Right:
            case VoxelGridOrientation.Left:
                m_DebugVoxelYOffsetSize.x = k_DebugYOffsetCubeThickness;
                break;
            }
        }
 public void IncludeData(TraitDataSnapshot data)
 {
     if (data.TryGetTrait(traitName, out int value))
     {
         m_Alignment = (MarsPlaneAlignment)(value | (int)m_Alignment);
     }
 }
 public void OptimizeForData(TraitDataSnapshot data)
 {
     if (data.TryGetTrait(traitName, out int value))
     {
         m_Alignment = (MarsPlaneAlignment)value;
     }
 }
        static void EditorEnsureAlignmentCondition(Proxy proxy, MarsPlaneAlignment alignment)
        {
            var ac = proxy.GetComponent <AlignmentCondition>();

            if (ac)
            {
                return;
            }

            ac           = Undo.AddComponent <AlignmentCondition>(proxy.gameObject);
            ac.alignment = alignment;
            AfterConfiguredComponent(ac);
        }
        static ProxyRegionForceTowards AddTowardsRegion(MarsPlaneAlignment alignment, bool isEdge, MenuCommand command)
        {
            var selection = CurrentEditorSelection(command);
            var placement = EditorAddPlacementTransform(ref selection,
                                                        "towards " + alignment.ToString(),
                                                        ForcesPreferences.instance.ProxyForceRegionTouching);
            var rf = Undo.AddComponent <ProxyRegionForceTowards>(selection);

            rf.regionTransform  = placement.transform;
            rf.towardsAlignment = alignment;
            rf.towardsEdgeOnly  = isEdge;
            AfterConfiguredComponent(rf);
            return(rf);
        }
 public SpatialOrientedPlaneSelector()
 {
     Orientation = MarsPlaneAlignment.Vertical;
 }