34 ForceFieldsInstanceBuf field_force_buf = {selection_type_,
"field_force_buf"};
35 ForceFieldsInstanceBuf field_wind_buf = {selection_type_,
"field_wind_buf"};
36 ForceFieldsInstanceBuf field_vortex_buf = {selection_type_,
"field_vortex_buf"};
37 ForceFieldsInstanceBuf field_curve_buf = {selection_type_,
"field_curve_buf"};
38 ForceFieldsInstanceBuf field_sphere_limit_buf = {selection_type_,
"field_sphere_limit_buf"};
39 ForceFieldsInstanceBuf field_tube_limit_buf = {selection_type_,
"field_tube_limit_buf"};
40 ForceFieldsInstanceBuf field_cone_limit_buf = {selection_type_,
"field_cone_limit_buf"};
48 call_buffers_.field_force_buf.clear();
49 call_buffers_.field_wind_buf.clear();
50 call_buffers_.field_vortex_buf.clear();
51 call_buffers_.field_curve_buf.clear();
52 call_buffers_.field_sphere_limit_buf.clear();
53 call_buffers_.field_tube_limit_buf.clear();
54 call_buffers_.field_cone_limit_buf.clear();
62 if (!ob_ref.object->pd || !ob_ref.object->pd->forcefield) {
65 const select::ID select_id = res.select_id(ob_ref);
66 const Object *ob = ob_ref.object;
72 ob->object_to_world(), res.object_background_blend_color(ob_ref,
state), 1.0f);
74 float &size_x = matrix[0][3];
75 float &size_y = matrix[1][3];
76 float &size_z = matrix[2][3];
82 call_buffers_.field_force_buf.append(
data, select_id);
86 call_buffers_.field_wind_buf.append(
data, select_id);
89 size_y = (pd->
f_strength < 0.0f) ? -size_y : size_y;
90 call_buffers_.field_vortex_buf.append(
data, select_id);
97 matrix.
location() = ob->object_to_world().location();
99 call_buffers_.field_curve_buf.append(
data, select_id);
102 matrix.
location() = ob->object_to_world().location();
104 call_buffers_.field_sphere_limit_buf.append(
data, select_id);
106 matrix.
location() = ob->object_to_world().location();
116 call_buffers_.field_tube_limit_buf.append(
data, select_id);
122 call_buffers_.field_tube_limit_buf.append(
data, select_id);
132 call_buffers_.field_cone_limit_buf.append(
data, select_id);
140 call_buffers_.field_cone_limit_buf.append(
data, select_id);
145 size_x = size_y = size_z = pd->
maxdist;
146 call_buffers_.field_sphere_limit_buf.append(
data, select_id);
149 size_x = size_y = size_z = pd->
mindist;
150 call_buffers_.field_sphere_limit_buf.append(
data, select_id);
158 res.select_bind(ps_);
160 state.clipping_plane_count);
161 ps_.shader_set(res.shaders->extra_shape.get());
165 call_buffers_.field_force_buf.end_sync(ps_, res.shapes.field_force.get());
166 call_buffers_.field_wind_buf.end_sync(ps_, res.shapes.field_wind.get());
167 call_buffers_.field_vortex_buf.end_sync(ps_, res.shapes.field_vortex.get());
168 call_buffers_.field_curve_buf.end_sync(ps_, res.shapes.field_curve.get());
169 call_buffers_.field_sphere_limit_buf.end_sync(ps_, res.shapes.field_sphere_limit.get());
170 call_buffers_.field_tube_limit_buf.end_sync(ps_, res.shapes.field_tube_limit.get());
171 call_buffers_.field_cone_limit_buf.end_sync(ps_, res.shapes.field_cone_limit.get());
177 manager.submit(ps_,
view);
bool BKE_where_on_path(const struct Object *ob, float ctime, float r_vec[4], float r_dir[3], float r_quat[4], float *r_radius, float *r_weight)
T & DRW_object_get_data_for_drawing(const Object &object)
void GPU_framebuffer_bind(blender::gpu::FrameBuffer *fb)
BMesh const char void * data
void object_sync(Manager &, const ObjectRef &ob_ref, Resources &res, const State &state) final
void end_sync(Resources &res, const State &state) final
void draw_line(Framebuffer &framebuffer, Manager &manager, View &view) final
void begin_sync(Resources &, const State &) final
ForceFields(const SelectionType selection_type)
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
@ DRW_STATE_DEPTH_LESS_EQUAL
select::SelectionType SelectionType
detail::Pass< command::DrawCommandBuf > PassSimple
T distance(const T &a, const T &b)
MatBase< T, NumCol, NumRow > translate(const MatBase< T, NumCol, NumRow > &mat, const VectorT &translation)
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
ObjectRuntimeHandle * runtime