42 BoundsInstanceBuf box = {selection_type_,
"bound_box"};
43 BoundsInstanceBuf sphere = {selection_type_,
"bound_sphere"};
44 BoundsInstanceBuf cylinder = {selection_type_,
"bound_cylinder"};
45 BoundsInstanceBuf cone = {selection_type_,
"bound_cone"};
46 BoundsInstanceBuf capsule_body = {selection_type_,
"bound_capsule_body"};
47 BoundsInstanceBuf capsule_cap = {selection_type_,
"bound_capsule_cap"};
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;
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) ||
82 const float4x4 object_mat{ob->object_to_world().ptr()};
83 const select::ID select_id = res.select_id(ob_ref);
89 call_buffers_.box.append(
data, select_id);
96 call_buffers_.sphere.append(
data, select_id);
104 call_buffers_.cylinder.append(
data, select_id);
112 std::swap(mat[1], mat[2]);
115 call_buffers_.cone.append(
data, select_id);
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.
T & DRW_object_get_data_for_drawing(const Object &object)
void GPU_framebuffer_bind(blender::gpu::FrameBuffer *fb)
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
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
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
@ DRW_STATE_DEPTH_LESS_EQUAL
select::SelectionType SelectionType
static bool is_from_dupli_or_set(const Object *ob)
detail::Pass< command::DrawCommandBuf > PassSimple
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)
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
VecBase< float, 2 > float2
VecBase< float, 3 > float3
float texspace_location[3]
float texspace_location[3]
struct RigidBodyOb * rigidbody_object