Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void RenderContext::Submit(const DebugBox& renderData)
- {
- #if defined(EDITOR) || defined(_DEBUG)
- Vector4 color = Vector4(renderData.m_Color.inst.Colors.r, renderData.m_Color.inst.Colors.g, renderData.m_Color.inst.Colors.b, renderData.m_Color.inst.Colors.a) * 0.00392156863f;
- /* FRONT FACE */
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(-renderData.m_Extents.x, renderData.m_Extents.y, -renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(renderData.m_Extents.x, renderData.m_Extents.y, -renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(renderData.m_Extents.x, renderData.m_Extents.y, -renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(renderData.m_Extents.x, -renderData.m_Extents.y, -renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(renderData.m_Extents.x, -renderData.m_Extents.y, -renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(-renderData.m_Extents.x, -renderData.m_Extents.y, -renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(-renderData.m_Extents.x, -renderData.m_Extents.y, -renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(-renderData.m_Extents.x, renderData.m_Extents.y, -renderData.m_Extents.z), 1.f), color });
- /* BACK FACE */
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(-renderData.m_Extents.x, renderData.m_Extents.y, renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(renderData.m_Extents.x, renderData.m_Extents.y, renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(renderData.m_Extents.x, renderData.m_Extents.y, renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(renderData.m_Extents.x, -renderData.m_Extents.y, renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(renderData.m_Extents.x, -renderData.m_Extents.y, renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(-renderData.m_Extents.x, -renderData.m_Extents.y, renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(-renderData.m_Extents.x, -renderData.m_Extents.y, renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(-renderData.m_Extents.x, renderData.m_Extents.y, renderData.m_Extents.z), 1.f), color });
- /* TOP */
- color = Vector4(1.f,0.f,1.f,1.f);
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(-renderData.m_Extents.x, renderData.m_Extents.y, -renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(-renderData.m_Extents.x, renderData.m_Extents.y, renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(renderData.m_Extents.x, renderData.m_Extents.y, -renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(renderData.m_Extents.x, renderData.m_Extents.y, renderData.m_Extents.z), 1.f), color });
- /* BOTTOM */
- color = Vector4(1.f, 1.f, 0.f, 1.f);
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(-renderData.m_Extents.x, -renderData.m_Extents.y, -renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(-renderData.m_Extents.x, -renderData.m_Extents.y, renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(renderData.m_Extents.x, -renderData.m_Extents.y, -renderData.m_Extents.z), 1.f), color });
- m_DebugDrawLines.push_back({ Vector4(renderData.m_Center + Vector3(renderData.m_Extents.x, -renderData.m_Extents.y, renderData.m_Extents.z), 1.f), color });
- #endif
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement