| 505 | } |
| 506 | |
| 507 | inline void DrawText3D(const DebugText3D& t, const RenderContext& renderContext, const Float3& viewUp, const Matrix& f, const Matrix& vp, const Viewport& viewport, GPUContext* context, GPUTextureView* target, GPUTextureView* depthBuffer) |
| 508 | { |
| 509 | Matrix w, fw, m; |
| 510 | if (t.FaceCamera) |
| 511 | { |
| 512 | Matrix s, ss; |
| 513 | Matrix::Scaling(t.Transform.Scale.X, s); |
| 514 | Matrix::CreateWorld(t.Transform.Translation, renderContext.View.Direction, viewUp, ss); |
| 515 | Matrix::Multiply(s, ss, w); |
| 516 | } |
| 517 | else |
| 518 | t.Transform.GetWorld(w); |
| 519 | Matrix::Multiply(f, w, fw); |
| 520 | Matrix::Multiply(fw, vp, m); |
| 521 | Render2D::Begin(context, target, depthBuffer, viewport, m); |
| 522 | const StringView text(t.Text.Get(), t.Text.Count() - 1); |
| 523 | Render2D::DrawText(DebugDrawFont->CreateFont((float)t.Size), text, t.Color, Vector2::Zero); |
| 524 | Render2D::End(); |
| 525 | } |
| 526 | |
| 527 | class DebugDrawService : public EngineService |
| 528 | { |