Example #1
0
        public void HalfTest(float value)
        {
            m_stream.WriteHalf(value);
            Assert.AreEqual(16, m_stream.BitOffset);

            m_stream.ResetRead();
            float peek = m_stream.PeekHalf();

            Assert.AreEqual(0, m_stream.BitOffset);

            float replica = m_stream.ReadHalf();

            Assert.AreEqual(16, m_stream.BitOffset);
            Assert.AreEqual(value, replica, 0.001f);
        }
 public static void WriteVector3(this BitStreamer stream, Vector3 value)
 {
     stream.WriteHalf(value.X);
     stream.WriteHalf(value.Y);
     stream.WriteHalf(value.Z);
 }