示例#1
0
        public override void Update()
        {
            if (Widget.Enabled)
            {
                //ScreenPos = new Vector3d(Settings.Tweak1 * 0.01, Settings.Tweak2*0.01, Settings.Tweak3*0.01);

                Widget.transform.Position = ScreenPos;
                Vector3d AP = Globals.Avatar.GetPosition();

                if (Target == AP)
                {
                    Target = AP + new Vector3d(0, 0, 1);
                }
                Matrix4d Rot = Matrix4d.CreateFromQuaternion(Globals.Avatar.GetRotation())
                               * Matrix4d.LookAt(Target, AP - Globals.Avatar.Up() * 2,
                                                 Globals.Avatar.Up());
                Widget.transform.Rotation = Rot.Inverted().ExtractRotation();
            }
        }