UE4-StaticMesh向场景DrawList添加流程

文章为本人学习虚幻4引擎源码所整理笔记,如有纰漏欢迎指正交流。

1.渲染线程Main Loop中: RenderingThreadMain( )  (RenderingThread.cpp)
2. 模型添加到场景里时,就会调用Render Scene的 AddPrimitive()函数, FScene :: AddPrimitive()函数中调用 FScene :: AddPrimitiveSceneInfo_RenderThread ()方法: (RendererScene.cpp)
3 . FScene :: AddPrimitiveSceneInfo_RenderThread ()方法会调用 FPrimitiveSceneInfo的
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const ImGuiID id = window->GetID(label); const ImVec2 label_size = CalcTextSize(label, NULL, true); const float w = GetWindowWidth() - 30; const float square_sz = 17; const ImVec2 pos = window->DC.CursorPos; const ImRect frame_bb(pos + ImVec2(w - square_sz - 13, 0), window->DC.CursorPos + ImVec2(w, square_sz - 1)); const ImRect total_bb(pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f)); ItemSize(total_bb, style.FramePadding.y); if (!ItemAdd(total_bb, id)) { IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0)); return false; } bool hovered, held; bool pressed = ButtonBehavior(frame_bb, id, &hovered, &held); if (pressed) { *v = !(*v); MarkItemEdited(id); } static std::map <ImGuiID, checkbox_animation> anim; auto it_anim = anim.find(id); if (it_anim == anim.end()) { anim.insert({ id, { 0.0f } }); it_anim = anim.find(id); } it_anim->second.animation = ImLerp(it_anim->second.animation, *v ? 1.0f : 0.0f, 0.12f * (1.0f - ImGui::GetIO().DeltaTime)); RenderNavHighlight(total_bb, id); RenderFrame(frame_bb.Min, frame_bb.Max, ImColor(225, 225, 225), false, 9.0f); RenderFrame(frame_bb.Min, frame_bb.Max, ImColor(34 / 255.0f, 139 / 255.0f, 230 / 255.0f, it_anim->second.animation), false, 9.0f); window->DrawList->AddCircleFilled(ImVec2(frame_bb.Min.x + 8 + 14 * it_anim->second.animation, frame_bb.Min.y + 8), 5.0f, ImColor(1.0f, 1.0f, 1.0f), 30); if (label_size.x > 0.0f) RenderText(total_bb.Min, label); IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0)); return pressed;翻一下这一段代码每一句的意思
06-01

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值