Example #1
0
            public SerializedProperties(SerializedObject serializedObject)
            {
                SDFGroup     = serializedObject.FindProperty("m_group");
                MainSettings = serializedObject.FindProperty("m_mainSettings");
                // AutoUpdate = MainSettings.FindPropertyRelative("m_autoUpdate");
                OutputMode         = MainSettings.FindPropertyRelative("m_outputMode");
                IsAsynchronous     = MainSettings.FindPropertyRelative("m_isAsynchronous");
                ProceduralMaterial = MainSettings.FindPropertyRelative("m_proceduralMaterial");

                AlgorithmSettings        = serializedObject.FindProperty("m_algorithmSettings");
                MaxAngleTolerance        = AlgorithmSettings.FindPropertyRelative("m_maxAngleTolerance");
                VisualNormalSmoothing    = AlgorithmSettings.FindPropertyRelative("m_visualNormalSmoothing");
                IsosurfaceExtractionType = AlgorithmSettings.FindPropertyRelative("m_isosurfaceExtractionType");
                ConstrainToCellUnits     = AlgorithmSettings.FindPropertyRelative("m_constrainToCellUnits");
                OverrideQEFSettings      = AlgorithmSettings.FindPropertyRelative("m_overrideQEFSettings");
                QEFSweeps = AlgorithmSettings.FindPropertyRelative("m_qefSweeps");
                QEFPseudoInverseThreshold          = AlgorithmSettings.FindPropertyRelative("m_qefPseudoInverseThreshold");
                EdgeIntersectionType               = AlgorithmSettings.FindPropertyRelative("m_edgeIntersectionType");
                BinarySearchIterations             = AlgorithmSettings.FindPropertyRelative("m_binarySearchIterations");
                ApplyGradientDescent               = AlgorithmSettings.FindPropertyRelative("m_applyGradientDescent");
                GradientDescentIterations          = AlgorithmSettings.FindPropertyRelative("m_gradientDescentIterations");
                NudgeVerticesToAverageNormalScalar = AlgorithmSettings.FindPropertyRelative("m_nudgeVerticesToAverageNormalScalar");
                NudgeMaxMagnitude = AlgorithmSettings.FindPropertyRelative("m_nudgeMaxMagnitude");

                VoxelSettings = serializedObject.FindProperty("m_voxelSettings");
                CellSizeMode  = VoxelSettings.FindPropertyRelative("m_cellSizeMode");
                CellSize      = VoxelSettings.FindPropertyRelative("m_cellSize");
                CellCount     = VoxelSettings.FindPropertyRelative("m_cellCount");
                VolumeSize    = VoxelSettings.FindPropertyRelative("m_volumeSize");
                CellDensity   = VoxelSettings.FindPropertyRelative("m_cellDensity");

                AddMeshRenderers     = serializedObject.FindProperty("m_addMeshRenderers");
                AddMeshColliders     = serializedObject.FindProperty("m_addMeshColliders");
                MeshRendererMaterial = serializedObject.FindProperty("m_meshRendererMaterial");
            }
Example #2
0
 public VoxelVolume(VoxelSettings settings)
 {
     Size        = settings.VoxelsPerChunk;
     Bounds.size = Size;
     PaddedSize  = Size + Vector3Int.one;
     VoxelCount  = PaddedSize.x * PaddedSize.y * PaddedSize.z;
     Voxels      = new NativeArray <float>(VoxelCount, Allocator.Persistent);
 }
Example #3
0
 public VoxelGeneratorNoise(VoxelSettings settings) : base(settings)
 {
 }
Example #4
0
 public static VoxelGenerator CreateInstance(VoxelSettings settings)
 {
     return(new VoxelGeneratorNoise(settings));
 }
Example #5
0
 public VoxelGenerator(VoxelSettings settings)
 {
     this.settings = settings;
     Volume        = new VoxelVolume(settings);
 }
Example #6
0
 public ChunkData(VoxelSettings voxelSettings, MeshSettings meshSettings)
 {
     voxelGen = VoxelGeneratorFactory.CreateInstance(voxelSettings);
     meshGen  = MeshGeneratorFactory.CreateInstance(meshSettings);
     meshGen.VoxelGenerator = voxelGen;
 }