Пример #1
0
        public override void DebugDraw()
        {
            base.DebugDraw();

            if (HumanoidEntity == null)
            {
                return;
            }

            HumanoidActions.AiTarget.DebugDraw();

            var headMatrix = HumanoidEntity.GetHeadMatrix(true, true, false, true);

            //    VRageRender.MyRenderProxy.DebugDrawAxis(headMatrix, 1.0f, false);
            VRageRender.MyRenderProxy.DebugDrawLine3D(headMatrix.Translation, headMatrix.Translation + headMatrix.Forward * 30, Color.HotPink, Color.HotPink, false);
            VRageRender.MyRenderProxy.DebugDrawAxis(HumanoidEntity.PositionComp.WorldMatrix, 1.0f, false);
            var invHeadMatrix = headMatrix;

            invHeadMatrix.Translation = Vector3.Zero;
            invHeadMatrix             = Matrix.Transpose(invHeadMatrix);
            invHeadMatrix.Translation = headMatrix.Translation;
        }
Пример #2
0
        public override void DebugDraw()
        {
            base.DebugDraw();

            if (HumanoidEntity == null)
            {
                return;
            }

            HumanoidActions.AiTargetBase.DebugDraw();

            var headMatrix = HumanoidEntity.GetHeadMatrix(true, true, false, true);

            //    VRageRender.MyRenderProxy.DebugDrawAxis(headMatrix, 1.0f, false);
            //VRageRender.MyRenderProxy.DebugDrawLine3D(headMatrix.Translation, headMatrix.Translation + headMatrix.Forward * 30, Color.HotPink, Color.HotPink, false);
            if (HumanoidActions.AiTargetBase.HasTarget())
            {
                HumanoidActions.AiTargetBase.DrawLineToTarget(headMatrix.Translation);

                Vector3D targetPos;
                float    radius;
                HumanoidActions.AiTargetBase.GetTargetPosition(headMatrix.Translation, out targetPos, out radius);
                if (targetPos != Vector3D.Zero)
                {
                    MyRenderProxy.DebugDrawSphere(targetPos, 0.3f, Color.Red, 0.4f, false);
                    VRageRender.MyRenderProxy.DebugDrawText3D(targetPos, "GetTargetPosition", Color.Red, 1, false);
                }
            }

            VRageRender.MyRenderProxy.DebugDrawAxis(HumanoidEntity.PositionComp.WorldMatrix, 1.0f, false);
            var invHeadMatrix = headMatrix;

            invHeadMatrix.Translation = Vector3.Zero;
            invHeadMatrix             = Matrix.Transpose(invHeadMatrix);
            invHeadMatrix.Translation = headMatrix.Translation;
        }