55 call_buffers_.box.
clear();
56 call_buffers_.sphere.
clear();
57 call_buffers_.cylinder.
clear();
58 call_buffers_.cone.
clear();
59 call_buffers_.capsule_body.
clear();
60 call_buffers_.capsule_cap.
clear();
68 const Object *ob = ob_ref.object;
69 const bool from_dupli = is_from_dupli_or_set(ob);
70 const bool has_bounds =
73 const bool show_extras = !from_dupli &&
state.show_extras();
77 const bool draw_bounds = has_bounds && ((ob->
dt ==
OB_BOUNDBOX) ||
79 const float4 color = res.object_wire_color(ob_ref,
state);
82 const float4x4 object_mat{ob->object_to_world().ptr()};
83 const select::ID select_id = res.select_id(ob_ref);
104 call_buffers_.cylinder.
append(
data, select_id);
112 std::swap(mat[1], mat[2]);
123 call_buffers_.capsule_cap.
append(
data, select_id);
126 data.object_to_world = object_mat * mat;
127 call_buffers_.capsule_cap.
append(
data, select_id);
129 data.object_to_world = object_mat * mat;
130 call_buffers_.capsule_body.
append(
data, select_id);
136 auto add_bounds = [&](
const bool around_origin,
const char bound_type) {
137 const std::optional<blender::Bounds<float3>> bounds_opt =
210 state.clipping_plane_count);
211 ps_.
shader_set(res.shaders->extra_shape.get());
214 res.select_bind(ps_);
216 call_buffers_.box.
end_sync(ps_, res.shapes.cube.get());
217 call_buffers_.sphere.
end_sync(ps_, res.shapes.empty_sphere.get());
218 call_buffers_.cylinder.
end_sync(ps_, res.shapes.cylinder.get());
219 call_buffers_.cone.
end_sync(ps_, res.shapes.empty_cone.get());
220 call_buffers_.capsule_body.
end_sync(ps_, res.shapes.capsule_body.get());
221 call_buffers_.capsule_cap.
end_sync(ps_, res.shapes.capsule_cap.get());
227 manager.submit(ps_,
view);
void BKE_curve_texspace_ensure(Curve *cu)
bool BKE_mball_is_basis(const Object *ob)
void BKE_mesh_texspace_ensure(Mesh *mesh)
std::optional< blender::Bounds< blender::float3 > > BKE_object_evaluated_geometry_bounds(const Object *ob)
std::optional< blender::Bounds< blender::float3 > > BKE_object_boundbox_get(const Object *ob)
#define BLI_assert_unreachable()
Types and defines for representing Rigid Body entities.
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
void state_set(DRWState state, int clip_plane_count=0)
void bind_ubo(const char *name, GPUUniformBuf *buffer)
void shader_set(GPUShader *shader)
void draw_line(Framebuffer &framebuffer, Manager &manager, View &view) final
void begin_sync(Resources &, const State &) final
Bounds(const SelectionType selection_type)
void end_sync(Resources &res, const State &state) final
void object_sync(Manager &, const ObjectRef &ob_ref, Resources &res, const State &state) final
Mesh & DRW_object_get_data_for_drawing(const Object &object)
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
@ DRW_STATE_DEPTH_LESS_EQUAL
MatBase< T, NumCol, NumRow > scale(const MatBase< T, NumCol, NumRow > &mat, const VectorT &scale)
T reduce_max(const VecBase< T, Size > &a)
T midpoint(const T &a, const T &b)
MatT from_scale(const VecBase< typename MatT::base_type, ScaleDim > &scale)
T max(const T &a, const T &b)
VecBase< float, 2 > float2
VecBase< float, 3 > float3
float texspace_location[3]
float texspace_location[3]
struct RigidBodyOb * rigidbody_object
void end_sync(PassSimple::Sub &pass, gpu::Batch *shape)
void append(const InstanceDataT &data, select::ID select_id)