|
Blender V4.3
|
#include <draw_debug.hh>
Public Member Functions | |
| ~DebugDraw () | |
| template<typename... Ts> | |
| void | print (StringRefNull str, Ts... args) |
| template<typename T > | |
| void | print (const T &value) |
| template<typename T > | |
| void | print_hex (const T &value) |
| template<typename T > | |
| void | print_binary (const T &value) |
| void | print_no_endl (std::string arg) |
| void | print_no_endl (StringRef arg) |
| void | print_no_endl (StringRefNull arg) |
| void | print_no_endl (char const *arg) |
| template<typename T > | |
| void | print_no_endl (T arg) |
| template<typename T , typename... Ts> | |
| void | print_no_endl (T arg, Ts... args) |
Init and state | |
| DebugDraw () | |
| void | init () |
| void | modelmat_reset () |
| void | modelmat_set (const float modelmat[4][4]) |
| GPUStorageBuf * | gpu_draw_buf_get () |
| GPUStorageBuf * | gpu_print_buf_get () |
Draw functions | |
| void | draw_line (float3 v1, float3 v2, float4 color={1, 0, 0, 1}) |
| void | draw_polygon (Span< float3 > face_verts, float4 color={1, 0, 0, 1}) |
| void | draw_bbox (const BoundBox &bbox, const float4 color={1, 0, 0, 1}) |
| void | draw_sphere (const float3 center, float radius, const float4 color={1, 0, 0, 1}) |
| void | draw_point (const float3 center, float radius=0.01f, const float4 color={1, 0, 0, 1}) |
| void | draw_matrix (const float4x4 &m4) |
| void | draw_matrix_as_bbox (const float4x4 &mat, const float4 color={1, 0, 0, 1}) |
Display | |
| void | display_to_view () |
Definition at line 43 of file draw_debug.hh.
| blender::draw::DebugDraw::DebugDraw | ( | ) |
|
inline |
Definition at line 67 of file draw_debug.hh.
| void blender::draw::DebugDraw::display_to_view | ( | ) |
Will draw all debug shapes and text cached up until now to the current view / frame-buffer. Draw buffers will be emptied and ready for new debug data.
Definition at line 580 of file draw_debug.cc.
References GPU_debug_group_begin(), GPU_debug_group_end(), and init().
| void blender::draw::DebugDraw::draw_bbox | ( | const BoundBox & | bbox, |
| const float4 | color = {1, 0, 0, 1} ) |
Definition at line 166 of file draw_debug.cc.
References col, draw_line(), and BoundBox::vec.
Referenced by draw_matrix_as_bbox().
Drawing functions that will draw wire-frames with the given color.
Definition at line 131 of file draw_debug.cc.
References draw_line(), and v2.
Referenced by draw_bbox(), draw_line(), draw_matrix(), draw_point(), draw_polygon(), and draw_sphere().
| void blender::draw::DebugDraw::draw_matrix | ( | const float4x4 & | m4 | ) |
Draw a matrix transformation as 3 colored axes.
Definition at line 149 of file draw_debug.cc.
References draw_line(), mul_project_m4_v3(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), and v2.
| void blender::draw::DebugDraw::draw_matrix_as_bbox | ( | const float4x4 & | mat, |
| const float4 | color = {1, 0, 0, 1} ) |
Draw a matrix as a 2 units length bounding box, centered on origin.
Definition at line 185 of file draw_debug.cc.
References BKE_boundbox_init_from_minmax(), draw_bbox(), min, mul_project_m4_v3(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), and BoundBox::vec.
| void blender::draw::DebugDraw::draw_point | ( | const float3 | center, |
| float | radius = 0.01f, | ||
| const float4 | color = {1, 0, 0, 1} ) |
Definition at line 206 of file draw_debug.cc.
References col, and draw_line().
| void blender::draw::DebugDraw::draw_polygon | ( | Span< float3 > | face_verts, |
| float4 | color = {1, 0, 0, 1} ) |
Definition at line 136 of file draw_debug.cc.
References BLI_assert, col, draw_line(), blender::Span< T >::is_empty(), blender::Span< T >::last(), and blender::math::transform_point().
| void blender::draw::DebugDraw::draw_sphere | ( | const float3 | center, |
| float | radius, | ||
| const float4 | color = {1, 0, 0, 1} ) |
Definition at line 196 of file draw_debug.cc.
References col, and draw_line().
| GPUStorageBuf * blender::draw::DebugDraw::gpu_draw_buf_get | ( | ) |
Not to be called by user. Should become private.
Definition at line 107 of file draw_debug.cc.
References blender::draw::detail::StorageCommon< T, len, device_only >::push_update().
| GPUStorageBuf * blender::draw::DebugDraw::gpu_print_buf_get | ( | ) |
Definition at line 116 of file draw_debug.cc.
References blender::draw::detail::StorageCommon< T, len, device_only >::push_update().
| void blender::draw::DebugDraw::init | ( | ) |
Resets all buffers and reset model matrix state. Not to be called by user.
Definition at line 67 of file draw_debug.cc.
References DRWDebugDrawBuffer::command, DRWDebugPrintBuffer::command, DrawCommand::instance_first_array, DrawCommand::instance_len, modelmat_reset(), DrawCommand::vertex_first, and DrawCommand::vertex_len.
Referenced by display_to_view().
| void blender::draw::DebugDraw::modelmat_reset | ( | ) |
Resets model matrix state to identity.
Definition at line 97 of file draw_debug.cc.
References blender::MatBase< float, 4, 4 >::identity().
Referenced by init().
| void blender::draw::DebugDraw::modelmat_set | ( | const float | modelmat[4][4] | ) |
Sets model matrix transform to apply to any vertex passed to drawing functions.
Definition at line 102 of file draw_debug.cc.
Definition at line 117 of file draw_debug.hh.
|
inline |
Log variable or strings inside the viewport. Using a unique non string argument will print the variable name with it. Concatenate by using multiple arguments. i.e: print("Looped ", n, "times.").
Definition at line 112 of file draw_debug.hh.
References print_no_endl(), and str.
Definition at line 127 of file draw_debug.hh.
Definition at line 122 of file draw_debug.hh.
|
inline |
Definition at line 148 of file draw_debug.hh.
|
inline |
Same as print() but does not finish the line.
Definition at line 136 of file draw_debug.hh.
Referenced by print(), and print_no_endl().
|
inline |
Definition at line 140 of file draw_debug.hh.
|
inline |
Definition at line 144 of file draw_debug.hh.
Definition at line 152 of file draw_debug.hh.
|
inline |
Definition at line 156 of file draw_debug.hh.
References print_no_endl().