Torque 3D 3.7
ContentsIndexHome
PreviousUpNext
BitStream Methods

The methods of the BitStream class are listed here.

 
Name 
Description 
 
Derived classes must override these... 
 
This is _write, a member of class BitStream. 
 
This is clear, a member of class BitStream. 
 
 
 
bitstream utility functions 
 
Uses the above method to reduce the precision of a normal vector so the server can determine exactly what is on the client. (Pre-dumbing the vector before sending to the client can result in precision errors...) 
 
HACK: We reverted BitStream to this previous version because it was crashing the build.
These are just here so that we don't have to revert the changes from the rest of the code.
9/11/2008 - Tom Spilman 
 
This is getBuffer, a member of class BitStream. 
 
This is getBytePtr, a member of class BitStream. 
 
INLINES 
 
This is getPacketStream, a member of class BitStream. 
 
Gets the position in the stream 
 
This is getReadByteSize, a member of class BitStream. 
 
Gets the size of the stream 
 
This is getWriteByteSize, a member of class BitStream. 
 
Checks to see if this stream has the capability of a given function 
 
This is isFull, a member of class BitStream. 
 
This is isValid, a member of class BitStream. 
 
This is readAffineTransform, a member of class BitStream. 
 
This is the overview for the readBits method overload. 
 
 
 
This is readCompressedPoint, a member of class BitStream. 
 
This is readCussedU32, a member of class BitStream. 
 
This is readFlag, a member of class BitStream. 
 
read and write floats... floats are 0 to 1 inclusive, signed floats are -1 to 1 inclusive 
 
This is readInt, a member of class BitStream. 
 
This is readNormalVector, a member of class BitStream. 
 
Reads a quaternion written with writeQuat.
@param quat The normalized quaternion to write. @param bitCount The the storage space for the xyz component of the quaternion. Must match the bitCount at write. @see writeQuat 
 
Reads a ranged floating point value written with writeRangedF32
 
Reads a ranged signed integer written with writeRangedS32
 
This is readRangedU32, a member of class BitStream. 
 
This is readSignedFloat, a member of class BitStream. 
 
This is readSignedInt, a member of class BitStream. 
 
 
 
Reads a compressed vector. @see writeVector 
 
This is sendPacketStream, a member of class BitStream. 
 
This is setBit, a member of class BitStream. 
 
This is setBuffer, a member of class BitStream. 
 
This is setCompressionPoint, a member of class BitStream. 
 
This is setCurPos, a member of class BitStream. 
 
Sets the position of the stream. Returns if the new position is valid or not 
 
This is setStringBuffer, a member of class BitStream. 
 
This is testBit, a member of class BitStream. 
 
writes an affine transform (full precision version) 
 
This is the overview for the writeBits method overload. 
 
This is writeClassId, a member of class BitStream. 
 
Matching calls to these compression methods must, of course, have matching scale values. 
 
Use this method to write out values in a concise but ass backwards way... Good for values you expect to be frequently zero, often small. Worst case this will bloat values by nearly 20% (5 extra bits!) Best case you'll get one bit (if it's zero).
This is not so much for efficiency's sake, as to make life painful for people that want to reverse engineer our network or file formats. 
 
This is the overview for the writeFlag method overload. 
 
This is writeFloat, a member of class BitStream. 
 
This is writeInt, a member of class BitStream. 
 
writes a normalized vector 
 
Writes a quaternion in a lossy compressed format that is ( bitCount * 3 ) + 1 bits in size.
@param quat The normalized quaternion to write. @param bitCount The the storage space for the xyz component of the quaternion. 
 
Writes a clamped floating point value to the stream with the desired bits of precision. 
 
Writes a clamped signed integer to the stream using an optimal amount of bits for the range. 
 
This is writeRangedU32, a member of class BitStream. 
 
This is writeSignedFloat, a member of class BitStream. 
 
This is writeSignedInt, a member of class BitStream. 
 
Writes a string to the stream. 
 
Writes a compressed vector as separate magnitude and normal components. The final space used depends on the content of the vector.
  • 1 bit is used to skip over zero length vectors.
  • 1 bit is used to mark if the magnitude exceeds max.
  • The magnitude as: a. magBits if less than maxMag. b. a full 32bit value if greater than maxMag.
  • The normal as a phi and theta sized normalBits+1 and normalBits.
 
Copyright (c) 2015. All rights reserved.
What do you think about this topic? Send feedback!