@@ -107,9 +107,22 @@ func readSpxBF22_V3(blockBts []byte, blkSplatCnt int, header *SpxHeader, datas *
107107
108108func readSpxBF220_WEBP_V3 (blockBts []byte , blkSplatCnt int , header * SpxHeader , datas * []* SplatData ) {
109109 bts := blockBts [8 :] // 除去前8字节(数量,格式)
110+
110111 size := cmn .BytesToUint32 (bts [:4 ])
111112 webps := bts [4 : size + 4 ]
112- btsPositions , _ , _ , err := cmn .DecompressWebp (webps )
113+ btsXyz0 , _ , _ , err := cmn .DecompressWebp (webps )
114+ cmn .ExitOnError (err )
115+
116+ bts = bts [size + 4 :]
117+ size = cmn .BytesToUint32 (bts [:4 ])
118+ webps = bts [4 : size + 4 ]
119+ btsXyz1 , _ , _ , err := cmn .DecompressWebp (webps )
120+ cmn .ExitOnError (err )
121+
122+ bts = bts [size + 4 :]
123+ size = cmn .BytesToUint32 (bts [:4 ])
124+ webps = bts [4 : size + 4 ]
125+ btsXyz2 , _ , _ , err := cmn .DecompressWebp (webps )
113126 cmn .ExitOnError (err )
114127
115128 bts = bts [size + 4 :]
@@ -141,19 +154,15 @@ func readSpxBF220_WEBP_V3(blockBts []byte, blkSplatCnt int, header *SpxHeader, d
141154 }
142155
143156 for n := range blkSplatCnt {
144- x0 := btsPositions [n * 4 + 0 ]
145- y0 := btsPositions [n * 4 + 1 ]
146- z0 := btsPositions [n * 4 + 2 ]
147- x1 := btsPositions [blkSplatCnt * 4 + n * 4 + 0 ]
148- y1 := btsPositions [blkSplatCnt * 4 + n * 4 + 1 ]
149- z1 := btsPositions [blkSplatCnt * 4 + n * 4 + 2 ]
150- x2 := btsPositions [blkSplatCnt * 8 + n * 4 + 0 ]
151- y2 := btsPositions [blkSplatCnt * 8 + n * 4 + 1 ]
152- z2 := btsPositions [blkSplatCnt * 8 + n * 4 + 2 ]
153- rx := btsRotations [n * 4 + 0 ]
154- ry := btsRotations [n * 4 + 1 ]
155- rz := btsRotations [n * 4 + 2 ]
156- ri := btsRotations [n * 4 + 3 ]
157+ x0 := btsXyz0 [n * 4 + 0 ]
158+ y0 := btsXyz0 [n * 4 + 1 ]
159+ z0 := btsXyz0 [n * 4 + 2 ]
160+ x1 := btsXyz1 [n * 4 + 0 ]
161+ y1 := btsXyz1 [n * 4 + 1 ]
162+ z1 := btsXyz1 [n * 4 + 2 ]
163+ x2 := btsXyz2 [n * 4 + 0 ]
164+ y2 := btsXyz2 [n * 4 + 1 ]
165+ z2 := btsXyz2 [n * 4 + 2 ]
157166
158167 data := & SplatData {}
159168 data .PositionX = cmn .DecodeLog (cmn .DecodeSpxPositionUint24 (x0 , x1 , x2 ), 1 )
@@ -166,6 +175,10 @@ func readSpxBF220_WEBP_V3(blockBts []byte, blkSplatCnt int, header *SpxHeader, d
166175 data .ColorG = btsColors [n * 4 + 1 ]
167176 data .ColorB = btsColors [n * 4 + 2 ]
168177 data .ColorA = btsColors [n * 4 + 3 ]
178+ rx := btsRotations [n * 4 + 0 ]
179+ ry := btsRotations [n * 4 + 1 ]
180+ rz := btsRotations [n * 4 + 2 ]
181+ ri := btsRotations [n * 4 + 3 ]
169182 data .RotationW , data .RotationX , data .RotationY , data .RotationZ = cmn .SogDecodeRotations (rx , ry , rz , ri )
170183
171184 if len (btsPaletteIdxs ) > 0 {
0 commit comments