|
Blender V5.0
|
#include <overlay_force_field.hh>
Inherits blender::draw::overlay::Overlay.
Public Member Functions | |
| ForceFields (const SelectionType selection_type) | |
| void | begin_sync (Resources &, const State &) final |
| 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 |
Draw force fields. Controlled by (Physics > Force Field)
Definition at line 25 of file overlay_force_field.hh.
|
inline |
Definition at line 44 of file overlay_force_field.hh.
|
inlinefinalvirtual |
Synchronization creates and fill render passes based on context state and scene state.
It runs for every scene update, so keep computation overhead low. If it is triggered, everything in the scene is considered updated. Note that this only concerns the render passes, the mesh batch caches are updated on a per object-data basis.
IMPORTANT: Synchronization must be view agnostic. That is, not rely on view position, projection matrix or frame-buffer size to do conditional pass creation. This is because, by design, syncing can happen once and rendered multiple time (multi view rendering, stereo rendering, orbiting view ...). Conditional pass creation, must be done in the drawing callbacks, but they should remain the exception. Also there will be no access to object data at this point. Creates passes used for object sync and enabling / disabling internal overlay types (e.g. vertices, edges, faces in edit mode). Runs once at the start of the sync cycle. Should also contain passes setup for overlays that are not per object overlays (e.g. Grid).
This method must be implemented.
Implements blender::draw::overlay::Overlay.
Definition at line 46 of file overlay_force_field.hh.
|
inlinefinalvirtual |
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 174 of file overlay_force_field.hh.
References GPU_framebuffer_bind(), and view.
|
inlinefinalvirtual |
Finalize passes or buffers used for object sync. Runs once at the start of the sync cycle.
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 155 of file overlay_force_field.hh.
References DRW_CLIPPING_UBO_SLOT, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, OVERLAY_GLOBALS_SLOT, and state.
|
inlinefinalvirtual |
Fills passes or buffers for each object. Runs for each individual object state. IMPORTANT: Can run only once for instances using the same state (ObjectRef might contains instancing data).
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 57 of file overlay_force_field.hh.
References BKE_where_on_path(), cosf, CU_PATH, data, DEG2RADF, blender::math::distance(), DRW_object_get_data_for_drawing(), Object::empty_drawsize, PartDeflect::f_strength, PartDeflect::falloff, Curve::flag, PartDeflect::flag, PartDeflect::forcefield, blender::MatBase< T, NumCol, NumRow, Alignment >::location(), PartDeflect::maxdist, PartDeflect::maxrad, PartDeflect::mindist, PartDeflect::minrad, OB_CURVES_LEGACY, Object::pd, PFIELD_FALL_CONE, PFIELD_FALL_SPHERE, PFIELD_FALL_TUBE, PFIELD_FORCE, PFIELD_GUIDE, PFIELD_USEMAX, PFIELD_USEMAXR, PFIELD_USEMIN, PFIELD_USEMINR, PFIELD_VORTEX, PFIELD_WIND, pos, Object::runtime, sinf, state, blender::math::translate(), and Object::type.
Referenced by blender::draw::overlay::Instance::object_sync().