@@ -550,7 +550,6 @@ void IWriter.Save(int fileIndex)
550
550
Tools . Shuffle ( ref nodeTempR ) ;
551
551
Tools . Shuffle ( ref nodeTempG ) ;
552
552
Tools . Shuffle ( ref nodeTempB ) ;
553
-
554
553
}
555
554
556
555
if ( importSettings . importIntensity == true ) Tools . Shuffle ( ref nodeTempIntensity ) ;
@@ -692,7 +691,7 @@ void IWriter.Save(int fileIndex)
692
691
py -= ( cellY * importSettings . gridSize ) ;
693
692
pz -= ( cellZ * importSettings . gridSize ) ;
694
693
695
- // pack G, PY and INTensity
694
+ // pack G, Py and INTensity
696
695
if ( importSettings . importRGB == true && importSettings . importIntensity == true && importSettings . importClassification == false )
697
696
{
698
697
float c = py ;
@@ -701,7 +700,7 @@ void IWriter.Save(int fileIndex)
701
700
byte bg = ( byte ) ( nodeTempG [ i ] * 255 ) ;
702
701
byte bi = nodeTempIntensity [ i ] ;
703
702
packedY = ( bg << 24 ) | ( bi << 16 ) | ( cIntegral << 8 ) | cFractional ;
704
- }
703
+ } // pack G, Py, CLASSification
705
704
else if ( importSettings . importRGB == true && importSettings . importIntensity == false && importSettings . importClassification == true )
706
705
{
707
706
float c = py ;
@@ -710,7 +709,7 @@ void IWriter.Save(int fileIndex)
710
709
byte bg = ( byte ) ( nodeTempG [ i ] * 255 ) ;
711
710
byte bc = nodeTempClassification [ i ] ;
712
711
packedY = ( bg << 24 ) | ( bc << 16 ) | ( cIntegral << 8 ) | cFractional ;
713
- }
712
+ } // pack G, Py, INTensity, CLASSification
714
713
else if ( importSettings . importRGB == true && importSettings . importIntensity == true && importSettings . importClassification == true )
715
714
{
716
715
float c = py ;
@@ -720,13 +719,13 @@ void IWriter.Save(int fileIndex)
720
719
byte bi = nodeTempIntensity [ i ] ;
721
720
packedY = ( bg << 24 ) | ( bi << 16 ) | ( cIntegral << 8 ) | cFractional ;
722
721
}
723
- else
722
+ else // pack G and Py
724
723
{
725
724
// pack green and y (note this is lossy, especially with *0.98)
726
725
py = Tools . SuperPacker ( nodeTempG [ i ] * 0.98f , py , importSettings . gridSize * importSettings . packMagicValue ) ;
727
726
}
728
727
729
- // pack red, x and classification (since intensity is already in green)
728
+ // pack Red, Px, CLASSification (since intensity is already in green)
730
729
if ( importSettings . importRGB == true && importSettings . importIntensity == true && importSettings . importClassification == true )
731
730
{
732
731
float c = px ;
@@ -736,9 +735,8 @@ void IWriter.Save(int fileIndex)
736
735
byte bc = nodeTempClassification [ i ] ;
737
736
packedX = ( br << 24 ) | ( bc << 16 ) | ( cIntegral << 8 ) | cFractional ;
738
737
}
739
- else
738
+ else // pack Red and Px
740
739
{
741
- // pack red and x
742
740
px = Tools . SuperPacker ( nodeTempR [ i ] * 0.98f , px , importSettings . gridSize * importSettings . packMagicValue ) ;
743
741
}
744
742
@@ -849,20 +847,19 @@ void IWriter.Save(int fileIndex)
849
847
{
850
848
IntToBytes ( packedX , pointBuffer , 0 ) ; // Convert int to bytes manually
851
849
}
852
- else
850
+ else // x, red
853
851
{
854
- // x, red
855
852
FloatToBytes ( px , pointBuffer , 0 ) ;
856
853
}
857
854
855
+ // packed: y, green, intensity AND/OR classification
858
856
if ( importSettings . packColors == true && importSettings . importRGB == true && ( importSettings . importIntensity == true || importSettings . importClassification == true ) )
859
857
{
860
858
// y, int, classification for now
861
859
IntToBytes ( packedY , pointBuffer , 4 ) ;
862
860
}
863
- else
861
+ else // y
864
862
{
865
- // y
866
863
FloatToBytes ( py , pointBuffer , 4 ) ;
867
864
}
868
865
0 commit comments