30 ForceFieldsInstanceBuf field_force_buf = {selection_type_,
"field_force_buf"};
31 ForceFieldsInstanceBuf field_wind_buf = {selection_type_,
"field_wind_buf"};
32 ForceFieldsInstanceBuf field_vortex_buf = {selection_type_,
"field_vortex_buf"};
33 ForceFieldsInstanceBuf field_curve_buf = {selection_type_,
"field_curve_buf"};
34 ForceFieldsInstanceBuf field_sphere_limit_buf = {selection_type_,
"field_sphere_limit_buf"};
35 ForceFieldsInstanceBuf field_tube_limit_buf = {selection_type_,
"field_tube_limit_buf"};
36 ForceFieldsInstanceBuf field_cone_limit_buf = {selection_type_,
"field_cone_limit_buf"};
44 call_buffers_.field_force_buf.clear();
45 call_buffers_.field_wind_buf.clear();
46 call_buffers_.field_vortex_buf.clear();
47 call_buffers_.field_curve_buf.clear();
48 call_buffers_.field_sphere_limit_buf.clear();
49 call_buffers_.field_tube_limit_buf.clear();
50 call_buffers_.field_cone_limit_buf.clear();
66 float &size_x = matrix[0][3];
67 float &size_y = matrix[1][3];
68 float &size_z = matrix[2][3];
74 call_buffers_.field_force_buf.append(
data, select_id);
78 call_buffers_.field_wind_buf.append(
data, select_id);
81 size_y = (pd->
f_strength < 0.0f) ? -size_y : size_y;
82 call_buffers_.field_vortex_buf.append(
data, select_id);
89 matrix.
location() = ob->object_to_world().location();
91 call_buffers_.field_curve_buf.append(
data, select_id);
94 matrix.
location() = ob->object_to_world().location();
96 call_buffers_.field_sphere_limit_buf.append(
data, select_id);
98 matrix.
location() = ob->object_to_world().location();
108 call_buffers_.field_tube_limit_buf.append(
data, select_id);
114 call_buffers_.field_tube_limit_buf.append(
data, select_id);
124 call_buffers_.field_cone_limit_buf.append(
data, select_id);
132 call_buffers_.field_cone_limit_buf.append(
data, select_id);
137 size_x = size_y = size_z = pd->
maxdist;
138 call_buffers_.field_sphere_limit_buf.append(
data, select_id);
141 size_x = size_y = size_z = pd->
mindist;
142 call_buffers_.field_sphere_limit_buf.append(
data, select_id);
152 state.clipping_plane_count);
156 call_buffers_.field_force_buf.end_sync(ps_, shapes.
field_force.get());
157 call_buffers_.field_wind_buf.end_sync(ps_, shapes.
field_wind.get());
158 call_buffers_.field_vortex_buf.end_sync(ps_, shapes.
field_vortex.get());
159 call_buffers_.field_curve_buf.end_sync(ps_, shapes.
field_curve.get());
161 call_buffers_.field_tube_limit_buf.end_sync(ps_, shapes.
field_tube_limit.get());
162 call_buffers_.field_cone_limit_buf.end_sync(ps_, shapes.
field_cone_limit.get());
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)
void GPU_framebuffer_bind(GPUFrameBuffer *framebuffer)
void submit(PassSimple &pass, View &view)
void draw(Framebuffer &framebuffer, Manager &manager, View &view)
ForceFields(const SelectionType selection_type)
void end_sync(Resources &res, ShapeCache &shapes, const State &state)
void object_sync(const ObjectRef &ob_ref, Resources &res, const State &state)
BatchPtr field_tube_limit
BatchPtr field_sphere_limit
BatchPtr field_cone_limit
@ 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
GPUUniformBuf * globals_buf
float4 object_background_blend_color(const ObjectRef &ob_ref, const State &state) const
void select_bind(PassSimple &pass)
const ID select_id(const ObjectRef &ob_ref, uint sub_object_id=0)