bytes = list(bytes)
value = 0
shift = 0
byteval = ord(bytes.pop(0))
if(byteval & 128) == 0: break
value |= ((byteval & 0x7F) << shift)
shift += 7
return (value | (byteval << shift))
temp = value
bytes = ""
while temp >= 128:
bytes += chr(0x000000FF & (temp | 0x80))
temp >>= 7
bytes += chr(temp)
x = encode7bit(345)
Wednesday, April 27, 2011
7 Bit Integer compression, in Python.
So, you've created a car prefab using WheelCollider components, and now you can apply a motorTorque to make the whole thing move along. ...
I've been investigating and learning Go . There is a lot of high quality tools out there, for example: - xo generates types and funct...
Some favourite quotes from Ron Jeffries, one of the three founders of the Extreme Programming software development methodology... Often yo...
I've been working on something new. I get a lot of projects where I have to add multiuser functionality. Finally I've made the jump ...
When you start working with threads in your Unity3D project, you will discover that many things need to be done in the main loop. For exampl...
As part of my quest to create amazing procedural spacecraft, I made a greebling tool for Unity. Here are the before and after screengrabs. ...
The NetworkManager instantiates a Player prefab. This is your Player Object. In a two player game, your GameObjects exist conceptually in ...
Thank to Adrian Boeing I was inspired this morning to hack together a ripple shader for Unity3D. Thanks for the math Adrian. You can see t...
In my efforts to write a malloc-free network library for Unity3D, I discovered that BinaryReader and BinaryWriter perform malloc operations ...