public void Deserialize(uint tick, ref DataStreamReader reader)
 {
     this.Tick     = tick;
     this.fillType = reader.ReadByte() == 1;
     this.centerX  = reader.ReadFloat();
     this.centerY  = reader.ReadFloat();
     this.radius   = reader.ReadFloat();
     this.shape    = (VoxelShape)reader.ReadInt();
 }
Exemple #2
0
 protected override void OnInit(Parameters parameters)
 {
     shape      = parameters.GetParameter <VoxelShape>(PARAMETER_SHAPE, VoxelShape.Sphere);
     radius     = parameters.GetParameter <fint>(PARAMETER_RADIUS, fint.half);
     height     = parameters.GetParameter <fint>(PARAMETER_HEIGHT, fint.two);
     position   = parameters.GetParameter <FVector3>(PARAMETER_POSITION, FVector3.zero);
     useGravity = parameters.GetParameter <bool>(PARAMETER_USE_GRAVITY, true);
     color      = parameters.GetParameter <FVector3>(PARAMETER_COLOR, FVector3.one);
 }
 public void Deserialize(uint tick, ref DataStreamReader reader, VoxelStencilInput baseline, NetworkCompressionModel compressionModel)
 {
     this.Tick     = tick;
     this.fillType = reader.ReadByte() == 1;
     this.centerX  = reader.ReadPackedFloat(compressionModel);
     this.centerY  = reader.ReadPackedFloat(compressionModel);
     this.radius   = reader.ReadPackedFloat(compressionModel);
     this.shape    = (VoxelShape)reader.ReadPackedInt(compressionModel);
     Deserialize(tick, ref reader);
 }
Exemple #4
0
        private RenderQueue getQueue(short id, VoxelShape shape)
        {
            Predicate <RenderQueue> idFinder = (RenderQueue q) => { return(q.id == id); };
            bool exists = queues.Exists(idFinder);

            if (exists)
            {
                return(queues.Find(idFinder));
            }
            else
            {
                RenderQueue q = new RenderQueue();
                q.id     = id;
                q.shape  = shape;
                q.voxels = new BitArray(parent.chunkSize * parent.chunkSize * parent.chunkSize);
                queues.Add(q);
                return(q);
            }
        }
Exemple #5
0
		internal VoxelBlobShape( VoxelShape[] cells, float cellWidth )
		{
			Cells = cells;
			CellWidth = cellWidth;
		}