protected virtual void OnReceiveCompass(NetworkMessage netMsg)
        {
            CompassMessage msg = netMsg.ReadMessage <CompassMessage> ();

            this.compass.trueHeading     = msg.trueHeading;
            this.compass.timestamp       = msg.timestamp;
            this.compass.headingAccuracy = msg.headingAccuracy;
            this.compass.magneticHeading = msg.magneticHeading;
            this.compass.rawVector       = msg.rawVector;
        }
Esempio n. 2
0
        protected virtual void SendCompass(Compass compass)
        {
            // send compass data
            CompassMessage msg = new CompassMessage();

            msg.trueHeading     = compass.trueHeading;
            msg.timestamp       = compass.timestamp;
            msg.headingAccuracy = compass.headingAccuracy;
            msg.magneticHeading = compass.magneticHeading;
            msg.rawVector       = compass.rawVector;
            this.Client.Send(InputMsgType.Compass, msg);
        }