30 BoundsInstanceBuf box = {selection_type_,
"bound_box"};
31 BoundsInstanceBuf sphere = {selection_type_,
"bound_sphere"};
32 BoundsInstanceBuf cylinder = {selection_type_,
"bound_cylinder"};
33 BoundsInstanceBuf cone = {selection_type_,
"bound_cone"};
34 BoundsInstanceBuf capsule_body = {selection_type_,
"bound_capsule_body"};
35 BoundsInstanceBuf capsule_cap = {selection_type_,
"bound_capsule_cap"};
43 call_buffers_.box.clear();
44 call_buffers_.sphere.clear();
45 call_buffers_.cylinder.clear();
46 call_buffers_.cone.clear();
47 call_buffers_.capsule_body.clear();
48 call_buffers_.capsule_cap.clear();
55 const bool has_bounds = !
ELEM(
57 const bool draw_bounds = has_bounds && ((ob->
dt ==
OB_BOUNDBOX) ||
61 auto add_bounds = [&](
const bool around_origin,
const char bound_type) {
65 const float4x4 object_mat{ob->object_to_world().ptr()};
77 call_buffers_.box.append(
data, select_id);
84 call_buffers_.sphere.append(
data, select_id);
92 call_buffers_.cylinder.append(
data, select_id);
100 std::swap(mat[1], mat[2]);
103 call_buffers_.cone.append(
data, select_id);
111 call_buffers_.capsule_cap.append(
data, select_id);
114 data.object_to_world_ = object_mat * mat;
115 call_buffers_.capsule_cap.append(
data, select_id);
117 data.object_to_world_ = object_mat * mat;
118 call_buffers_.capsule_body.append(
data, select_id);
152 state.clipping_plane_count);
157 call_buffers_.box.end_sync(ps_, shapes.
cube.get());
158 call_buffers_.sphere.end_sync(ps_, shapes.
empty_sphere.get());
159 call_buffers_.cylinder.end_sync(ps_, shapes.
cylinder.get());
160 call_buffers_.cone.end_sync(ps_, shapes.
empty_cone.get());
161 call_buffers_.capsule_body.end_sync(ps_, shapes.
capsule_body.get());
162 call_buffers_.capsule_cap.end_sync(ps_, shapes.
capsule_cap.get());
bool BKE_mball_is_basis(const Object *ob)
std::optional< blender::Bounds< blender::float3 > > BKE_object_boundbox_get(const Object *ob)
Types and defines for representing Rigid Body entities.
void GPU_framebuffer_bind(GPUFrameBuffer *framebuffer)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void submit(PassSimple &pass, View &view)
void object_sync(const ObjectRef &ob_ref, Resources &res, const State &state)
Bounds(const SelectionType selection_type)
void end_sync(Resources &res, ShapeCache &shapes, const State &state)
void draw(Framebuffer &framebuffer, Manager &manager, View &view)
@ DRW_STATE_DEPTH_LESS_EQUAL
select::SelectionType SelectionType
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
struct RigidBodyOb * rigidbody_object
const float4 & object_wire_color(const ObjectRef &ob_ref, ThemeColorID theme_id) const
GPUUniformBuf * globals_buf
void select_bind(PassSimple &pass)
const ID select_id(const ObjectRef &ob_ref, uint sub_object_id=0)