MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / DrawText3D

Function DrawText3D

Source/Engine/Debug/DebugDraw.cpp:507–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

505}
506
507inline 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
527class DebugDrawService : public EngineService
528{

Callers 1

DrawMethod · 0.85

Calls 8

ScalingFunction · 0.85
CreateFontMethod · 0.80
MultiplyFunction · 0.50
BeginFunction · 0.50
EndFunction · 0.50
GetWorldMethod · 0.45
GetMethod · 0.45
CountMethod · 0.45

Tested by

no test coverage detected