Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ScriptBitWriter Interface Reference
Inheritance diagram for ScriptBitWriter:
[legend]

Public Member Functions

proto void Write (void src, int sizeInBits)
 Writes sizeInBits bits of data to internal storage.
 
proto void WriteRplId (RplId val)
 Compresses a RplId and writes it to internal storage.
 
proto void WriteEntityId (EntityID val)
 Compresses a EntityID and writes it to internal storage.
 
proto void WriteInt (int val)
 Compresses an integer and writes it to internal storage.
 
proto void WriteIntRange (int val, int min, int max)
 Compresses an integer and writes it to internal storage.
 
proto void WriteHalf (float val)
 Compresses a float into a half and writes it to internal storage.
 
proto void WriteFloat01 (float val)
 Compresses a float into <0;1> range and writes it to internal storage.
 
proto void WriteRadian (float val)
 Compresses an angle in radians and writes it to internal storage.
 
proto void WriteQuaternion (float val[4])
 Compresses a quaternion and writes it to internal storage.
 
proto void WriteResourceName (ResourceName val)
 Writes a ResourceName to internal storage.
 
proto void WriteString (string val)
 Writes a string to internal storage.
 
proto native int Tell ()
 Returns the current position in internal storage in bits.
 
void WriteBool (bool val)
 
void WriteFloat (float val)
 
void WriteVector (vector val)
 
- Public Member Functions inherited from Managed
proto external ref Managed Clone ()
 Return shallow copy of object, or null if it is not allowed (not public constructor)
 

Member Function Documentation

◆ Tell()

proto native int ScriptBitWriter.Tell ( )

Returns the current position in internal storage in bits.

◆ Write()

proto void ScriptBitWriter.Write ( void  src,
int  sizeInBits 
)

Writes sizeInBits bits of data to internal storage.

◆ WriteBool()

void ScriptBitWriter.WriteBool ( bool  val)

◆ WriteEntityId()

proto void ScriptBitWriter.WriteEntityId ( EntityID  val)

Compresses a EntityID and writes it to internal storage.

The resulting data is about 1 to 8 bytes in size.

◆ WriteFloat()

void ScriptBitWriter.WriteFloat ( float  val)

◆ WriteFloat01()

proto void ScriptBitWriter.WriteFloat01 ( float  val)

Compresses a float into <0;1> range and writes it to internal storage.

The resulting data is 1 byte in size.

◆ WriteHalf()

proto void ScriptBitWriter.WriteHalf ( float  val)

Compresses a float into a half and writes it to internal storage.

The resulting data is 2 bytes in size.

Warning
Half only gives you about 64k +/- of range for the decimal part.

◆ WriteInt()

proto void ScriptBitWriter.WriteInt ( int  val)

Compresses an integer and writes it to internal storage.

Compression goes down to the byte level. Therefore, the resulting data is about 1 to 4 bytes in size.

Warning
If you know the range is constant use WriteIntRange() instead.

◆ WriteIntRange()

proto void ScriptBitWriter.WriteIntRange ( int  val,
int  min,
int  max 
)

Compresses an integer and writes it to internal storage.

Compression uses only as many bits as necessary taking the range defined by {min..max} into account.

Warning
Use this only when you know the range is constant!

◆ WriteQuaternion()

proto void ScriptBitWriter.WriteQuaternion ( float  val[4])

Compresses a quaternion and writes it to internal storage.

The resulting data is 4 byte in size.

◆ WriteRadian()

proto void ScriptBitWriter.WriteRadian ( float  val)

Compresses an angle in radians and writes it to internal storage.

The resulting data is 1 byte in size.

◆ WriteResourceName()

proto void ScriptBitWriter.WriteResourceName ( ResourceName  val)

Writes a ResourceName to internal storage.

The resulting data is 8 byte in size.

◆ WriteRplId()

proto void ScriptBitWriter.WriteRplId ( RplId  val)

Compresses a RplId and writes it to internal storage.

The resulting data is about 1 to 4 bytes in size.

◆ WriteString()

proto void ScriptBitWriter.WriteString ( string  val)

Writes a string to internal storage.

◆ WriteVector()

void ScriptBitWriter.WriteVector ( vector  val)

The documentation for this interface was generated from the following file: