Module pyinsim :: Class CompCar
[hide private]
[frames] | no frames]

Class CompCar

source code

Car info in 28 bytes - there is an array of these in the MCI (below)

Instance Methods [hide private]
 
__init__(self, Node=0, Lap=0, PLID=0, Position=0, Info=0, X=0, Y=0, Z=0, Speed=0, Direction=0, Heading=0, AngVel=0)
Initialise the packet.
source code
string
pack(self)
Pack the packet values into a binary formatted string.
source code
 
unpack(self, data)
Unpack the packet data from a binary formatted string.
source code
Method Details [hide private]

__init__(self, Node=0, Lap=0, PLID=0, Position=0, Info=0, X=0, Y=0, Z=0, Speed=0, Direction=0, Heading=0, AngVel=0)
(Constructor)

source code 

Initialise the packet.

Parameters:
  • Node - current path node
  • Lap - current lap
  • PLID - player's unique id
  • Position - current race position : 0 = unknown, 1 = leader, etc...
  • Info - flags and other info - see below
  • X - X map (65536 = 1 metre)
  • Y - Y map (65536 = 1 metre)
  • Z - Z alt (65536 = 1 metre)
  • Speed - speed (32768 = 100 m/s)
  • Direction - direction of car's motion : 0 = world y direction, 32768 = 180 deg
  • Heading - direction of forward axis : 0 = world y direction, 32768 = 180 deg
  • AngVel - signed, rate of change of heading : (16384 = 360 deg/s)

pack(self)

source code 

Pack the packet values into a binary formatted string.

Returns: string
A binary formatted string.

unpack(self, data)

source code 

Unpack the packet data from a binary formatted string.

Parameters:
  • data (string) - The packet data as a binary formatted string.