예제 #1
0
 public int GetVoxel(MiniPoint3 Coordinate)
 {
     if (RawBuffer == null)
     {
         return(Voxel);
     }
     return(RawBuffer[EncodeIndex(Coordinate.X - Origin.X, Coordinate.Y - Origin.Y, Coordinate.Z - Origin.Z)]);
 }
예제 #2
0
        private int EncodeIndex(MiniPoint3 Coordinate)
        {
            var x = ((Coordinate.X - Origin.X) >> 3) & 0x1;
            var y = ((Coordinate.Y - Origin.Y) >> 3) & 0x1;
            var z = ((Coordinate.Z - Origin.Z) >> 3) & 0x1;

            return(Level2.EncodeIndex(x, y, z));
        }
예제 #3
0
        public int GetVoxel(MiniPoint3 Coordinate)
        {
            if (Children == null)
            {
                return(Voxel);
            }

            return(Children[EncodeIndex(Coordinate)].GetVoxel(Coordinate));
        }
예제 #4
0
        public void SetVoxel(MiniPoint3 Coordinate, int Voxel)
        {
            if (RawBuffer == null)
            {
                if (this.Voxel == Voxel)
                {
                    return;
                }
                Subdivide();
            }

            RawBuffer[EncodeIndex(Coordinate.X - Origin.X, Coordinate.Y - Origin.Y, Coordinate.Z - Origin.Z)] = Voxel;
        }
예제 #5
0
        public void SetVoxel(MiniPoint3 Coordinate, int Voxel)
        {
            if (Children == null)
            {
                if (this.Voxel == Voxel)
                {
                    return;
                }
                Subdivide();
            }

            Children[EncodeIndex(Coordinate)].SetVoxel(Coordinate, Voxel);
        }
예제 #6
0
 public Level4(MiniPoint3 Origin, int Voxel)
 {
     this.Origin = Origin;
     this.Voxel  = Voxel;
 }
예제 #7
0
 private int EncodeIndex(MiniPoint3 Coordinate)
 {
     return((Coordinate.Y >> 4) & 0x3);
 }
예제 #8
0
 public Level2(MiniPoint3 Min, int Voxel)
 {
     Origin     = Min;
     this.Voxel = Voxel;
 }