Example #1
0
        private void OnHitted(TestVolumeHit hit)
        {
            var s = hit.startHitPosition;
            var e = hit.endHitPosition;

            var builderRequest = new VoxelBuilderRequest
            {
                startBuildPoint = hit.startHitPosition,
                endBuildPoint   = hit.endHitPosition,
                chunkSize       = _chunkSize,
                voxel           = new VoxelEntity(),
                pattern         = VoxelBuilderPatternType.Line,
                model           = hit.model
            };

            var response = _voxelBuilderController.Execute(builderRequest);

            foreach (var chunkIndex in response.updatedChunkIds)
            {
                var geometryRequest =
                    TestGeometryRequestUtility.CreateVolumeRequest(chunkIndex, _chunkSize, hit.model, new Vector3Int());
                _chunkRequestQueue.Push(geometryRequest);
            }

            ExecutePhysics(s, _chunkSize, hit.model);
        }
Example #2
0
    private void OnHitted(Vector3Int startPoint, Vector3Int endPoint)
    {
        var builderRequest = new VoxelBuilderRequest
        {
            startBuildPoint = startPoint,
            endBuildPoint   = endPoint,
            chunkSize       = _chunkSize,
            voxel           = new VoxelEntity(),
            pattern         = VoxelBuilderPatternType.Line,
            model           = _voxelModel
        };

        var response = _voxelBuilderController.Execute(builderRequest);

        foreach (var chunkIndex in response.updatedChunkIds)
        {
            var geometryRequest = GetGeometryRequestById(chunkIndex);
            _chunkRequestQueue.Push(geometryRequest);
        }

        ExecutePhysics(startPoint, _chunkSize);
    }