Example #1
0
        private void DrawSkeleton(ulong mesh, PlayerCameraManager CameraManager, WindowRenderTarget device, Brush brush, TextFormat font)
        {
            Vector2 vHead, vRoot, vCenter;
            var     bRoot  = DoGame.GetBoneWithRotation(mesh, Bones.Root);
            var     middle = DoGame.GetBoneWithRotation(mesh, Bones.pelvis);

            WorldToScreen(bRoot, CameraManager, out vRoot);
            WorldToScreen(middle, CameraManager, out vCenter);

            var flWidth  = Math.Abs(vRoot.Y - vCenter.Y) / 2;
            var flHeight = Math.Abs(vRoot.Y - vCenter.Y);

            vHead.X = vCenter.X - flWidth;
            vHead.Y = vCenter.Y - flHeight;
            //2d box drawing
            //2d box drawing
            DrawLine(vCenter.X - flWidth, vHead.Y, vCenter.X + flWidth, vHead.Y, device, brush); // top
            DrawLine(vCenter.X - flWidth, vRoot.Y, vCenter.X + flWidth, vRoot.Y, device, brush); // bottom
            DrawLine(vCenter.X - flWidth, vHead.Y, vCenter.X - flWidth, vRoot.Y, device, brush); // left
            DrawLine(vCenter.X + flWidth, vRoot.Y, vCenter.X + flWidth, vHead.Y, device, brush); // right


            //Bones[] l = { Bones.forehead, Bones.Head,Bones.neck_01,Bones.hand_l,Bones.hand_r,Bones.foot_l,Bones.foot_r};
            //foreach (var b in l)
            //{
            //    Vector3 pos = DoGame.GetBoneWithRotation(mesh, (Bones)b);
            //    Vector2 h1;
            //    WorldToScreen(pos, CameraManager, out h1);
            //    var radarPlayerRectangle = new RoundedRectangle()
            //    {
            //        RadiusX = 4,
            //        RadiusY = 4,
            //        Rect = new RawRectangleF(h1.X, h1.Y, h1.X + 4,
            //            h1.Y + 4)
            //    };
            //    var fontFactory = new SharpDX.DirectWrite.Factory();
            //    var fontConsolas = new SharpDX.DirectWrite.TextFormat(fontFactory, "Consolas", 15);
            //    var fontESP = new SharpDX.DirectWrite.TextFormat(fontFactory, "Consolas", 12);
            //    DrawText(b.ToString(), (int)h1.X + 4,
            //        (int)(int)h1.Y + 4,
            //        new SolidColorBrush(device, RawColorFromColor(Color.White))
            //        , fontFactory,
            //        fontESP,
            //        device);

            //    device.FillRoundedRectangle(radarPlayerRectangle, brush);

            //}
        }
Example #2
0
        private void DrawSkeleton(ulong mesh, PlayerCameraManager CameraManager, WindowRenderTarget device, Brush brush, TextFormat font)
        {
            Vector2 vHead, vRoot, vCenter;
            var     bRoot  = DoGame.GetBoneWithRotation(mesh, Bones.Root);
            var     middle = DoGame.GetBoneWithRotation(mesh, Bones.pelvis);

            if (WorldToScreen(bRoot, CameraManager, out vRoot) && WorldToScreen(middle, CameraManager, out vCenter))
            {
                var flWidth  = Math.Abs(vRoot.Y - vCenter.Y) / 2;
                var flHeight = Math.Abs(vRoot.Y - vCenter.Y);
                vHead.X = vCenter.X - flWidth;
                vHead.Y = vCenter.Y - flHeight;
                //2d box drawing
                //2d box drawing
                DrawLine(vCenter.X - flWidth, vHead.Y, vCenter.X + flWidth, vHead.Y, device, brush); // top
                DrawLine(vCenter.X - flWidth, vRoot.Y, vCenter.X + flWidth, vRoot.Y, device, brush); // bottom
                DrawLine(vCenter.X - flWidth, vHead.Y, vCenter.X - flWidth, vRoot.Y, device, brush); // left
                DrawLine(vCenter.X + flWidth, vRoot.Y, vCenter.X + flWidth, vHead.Y, device, brush); // right
            }
        }