protected internal override void Deserialize(BinaryReader br) { CarId = br.ReadByte(); WorldPosition = readVector3f(br); Velocity = readVector3f(br); Gear = br.ReadByte(); EngineRPM = br.ReadUInt16(); NormalizedSplinePosition = br.ReadSingle(); }
protected internal override void Deserialize(System.IO.BinaryReader br) { Subtype = br.ReadByte(); CarId = br.ReadByte(); if (Subtype == (byte)ACSProtocol.MessageType.ACSP_CE_COLLISION_WITH_CAR) OtherCarId = br.ReadByte(); RelativeVelocity = br.ReadSingle(); WorldPosition = readVector3f(br); RelativePosition = readVector3f(br); }
protected static Vector3f readVector3f(BinaryReader br) { Vector3f res = new Vector3f(); res.X = br.ReadSingle(); res.Y = br.ReadSingle(); res.Z = br.ReadSingle(); return res; }
protected static void writeVector3f(BinaryWriter bw, Vector3f vec) { bw.Write(vec.X); bw.Write(vec.Y); bw.Write(vec.Z); }