Exemplo n.º 1
0
        void HandleOrientationUpdate()
        {
            byte  id    = reader.ReadUInt8();
            float rotY  = (float)Utils.PackedToDegrees(reader.ReadUInt8());
            float headX = (float)Utils.PackedToDegrees(reader.ReadUInt8());

            LocationUpdate update = LocationUpdate.MakeOri(rotY, headX);

            net.UpdateLocation(id, update, true);
        }
Exemplo n.º 2
0
        internal void HandleOrientationUpdate()
        {
            byte  id    = reader.ReadUInt8();
            float yaw   = (float)Utils.PackedToDegrees(reader.ReadUInt8());
            float pitch = (float)Utils.PackedToDegrees(reader.ReadUInt8());

            LocationUpdate update = LocationUpdate.MakeOri(yaw, pitch);

            UpdateLocation(id, update, true);
        }
Exemplo n.º 3
0
        protected void MoveInDirection(Entity source, Vector3 dir)
        {
            double rotYRadians, headXRadians;

            Utils.GetHeading(dir, out rotYRadians, out headXRadians);

            float          rotY   = (float)(rotYRadians * Utils.Rad2Deg);
            float          headX  = (float)(headXRadians * Utils.Rad2Deg);
            LocationUpdate update = LocationUpdate.MakeOri(rotY, headX);

            source.SetLocation(update, false);
            MoveVelocity = dir * 0.9f;
        }