package skadistats.clarity.decoder.unpacker;

import skadistats.clarity.decoder.BitStream;
import skadistats.clarity.model.Vector;

public class QAnglePitchYawOnlyUnpacker implements Unpacker<Vector> {

    private final int nBits;

    public QAnglePitchYawOnlyUnpacker(int nBits) {
        this.nBits = nBits;
    }

    @Override
    public Vector unpack(BitStream bs) {
        if ((nBits | 0x20) == 0x20) {
            throw new RuntimeException("implement me!");
        }
        float[] v = new float[3];
        v[0] = bs.readBitAngle(nBits);
        v[1] = bs.readBitAngle(nBits);
        v[2] = 0.0f;
        return new Vector(v);
    }
    
}

@@ -363,24 +363,58 @@
 tream bs) %7B%0A
+        float%5B%5D v = new float%5B3%5D;%0A
         if (
@@ -455,50 +455,54 @@
     
-throw new RuntimeException(%22implement me!%22
+v%5B0%5D = Float.intBitsToFloat(bs.readUBitInt(32)
 );%0A 
@@ -512,44 +512,82 @@
     
-%7D%0A
     
-    float%5B%5D v = new float%5B3%5D;%0A
+v%5B1%5D = Float.intBitsToFloat(bs.readUBitInt(32));%0A        %7D else %7B%0A    
     
@@ -613,32 +613,36 @@
 itAngle(nBits);%0A
+    
         v%5B1%5D = b
@@ -676,20 +676,9 @@
     
-v%5B2%5D = 0.0f;
+%7D
 %0A   

implement missing case