me-main #1

Merged
Nate Rupsis merged 123 commits from me-main into main 2023-02-13 18:39:11 +01:00
9 changed files with 48 additions and 45 deletions
Showing only changes of commit 4cbe0bff34 - Show all commits

View File

@ -424,10 +424,9 @@ bool GHOST_SystemWin32::processEvents(bool waitForEvent)
processTrackpad(); processTrackpad();
/* PeekMessage above is allowed to dispatch messages to the wndproc without us /* `PeekMessage` above is allowed to dispatch messages to the `wndproc` without us
* noticing, so we need to check the event manager here to see if there are * noticing, so we need to check the event manager here to see if there are
* events waiting in the queue. * events waiting in the queue. */
*/
hasEventHandled |= this->m_eventManager->getNumEvents() > 0; hasEventHandled |= this->m_eventManager->getNumEvents() > 0;
} while (waitForEvent && !hasEventHandled); } while (waitForEvent && !hasEventHandled);

View File

@ -176,7 +176,7 @@ struct MeshRuntime {
/** /**
* A bit vector the size of the number of edges, set to true for edges that should be drawn in * A bit vector the size of the number of edges, set to true for edges that should be drawn in
* the viewport. Created by the "Optimimal Display" feature of the subdivision surface modifier. * the viewport. Created by the "Optimal Display" feature of the subdivision surface modifier.
* Otherwise it will be empty. * Otherwise it will be empty.
*/ */
BitVector<> subsurf_optimal_display_edges; BitVector<> subsurf_optimal_display_edges;

View File

@ -772,7 +772,7 @@ bool get_effector_data(EffectorCache *eff,
if (eff->pd->forcefield == PFIELD_VORTEX || eff->pd->shape == PFIELD_SHAPE_LINE) { if (eff->pd->forcefield == PFIELD_VORTEX || eff->pd->shape == PFIELD_SHAPE_LINE) {
add_v3_v3v3(efd->loc, ob->object_to_world[3], translate); add_v3_v3v3(efd->loc, ob->object_to_world[3], translate);
} }
else { /* normally efd->loc is closest point on effector xy-plane */ else { /* Normally `efd->loc` is closest point on effector XY-plane. */
sub_v3_v3v3(efd->loc, point->loc, translate); sub_v3_v3v3(efd->loc, point->loc, translate);
} }
} }
@ -1125,31 +1125,31 @@ void BKE_effectors_apply(ListBase *effectors,
/* WARNING(@ideasman42): historic comment? /* WARNING(@ideasman42): historic comment?
* Many of these parameters don't exist! * Many of these parameters don't exist!
* *
* scene = scene where it runs in, for time and stuff. * `scene` = scene where it runs in, for time and stuff.
* lb = listbase with objects that take part in effecting. * `lb` = listbase with objects that take part in effecting.
* opco = global coord, as input. * `opco` = global coord, as input.
* force = accumulator for force. * `force` = accumulator for force.
* wind_force = accumulator for force only acting perpendicular to a surface. * `wind_force` = accumulator for force only acting perpendicular to a surface.
* speed = actual current speed which can be altered. * `speed` = actual current speed which can be altered.
* cur_time = "external" time in frames, is constant for static particles. * `cur_time` = "external" time in frames, is constant for static particles.
* loc_time = "local" time in frames, range <0-1> for the lifetime of particle. * `loc_time` = "local" time in frames, range <0-1> for the lifetime of particle.
* par_layer = layer the caller is in. * `par_layer` = layer the caller is in.
* flags = only used for soft-body wind now. * `flags` = only used for soft-body wind now.
* guide = old speed of particle. * `guide` = old speed of particle.
*/ */
/* /*
* Modifies the force on a particle according to its * Modifies the force on a particle according to its
* relation with the effector object * relation with the effector object
* Different kind of effectors include: * Different kind of effectors include:
* Force-fields: Gravity-like attractor * - Force-fields: Gravity-like attractor
* (force power is related to the inverse of distance to the power of a falloff value) * (force power is related to the inverse of distance to the power of a falloff value)
* Vortex fields: swirling effectors * - Vortex fields: swirling effectors
* (particles rotate around Z-axis of the object. otherwise, same relation as) * (particles rotate around Z-axis of the object. otherwise, same relation as)
* (Force-fields, but this is not done through a force/acceleration) * (Force-fields, but this is not done through a force/acceleration)
* Guide: particles on a path * - Guide: particles on a path
* (particles are guided along a curve bezier or old nurbs) * (particles are guided along a curve bezier or old nurbs)
* (is independent of other effectors) * (is independent of other effectors)
*/ */
EffectorCache *eff; EffectorCache *eff;
EffectorData efd; EffectorData efd;

View File

@ -117,7 +117,7 @@ struct DupliContext {
* decisions. However, new code uses geometry instances in places that weren't using the dupli * decisions. However, new code uses geometry instances in places that weren't using the dupli
* system previously. To fix this, keep track of the last dupli generator type that wasn't a * system previously. To fix this, keep track of the last dupli generator type that wasn't a
* geometry set instance. * geometry set instance.
* */ */
Vector<short> *dupli_gen_type_stack; Vector<short> *dupli_gen_type_stack;
int persistent_id[MAX_DUPLI_RECUR]; int persistent_id[MAX_DUPLI_RECUR];

View File

@ -590,7 +590,7 @@ static void initialize_all_particles(ParticleSimulationData *sim)
{ {
ParticleSystem *psys = sim->psys; ParticleSystem *psys = sim->psys;
ParticleSettings *part = psys->part; ParticleSettings *part = psys->part;
/* Grid distributionsets UNEXIST flag, need to take care of /* Grid distribution-sets UNEXIST flag, need to take care of
* it here because later this flag is being reset. * it here because later this flag is being reset.
* *
* We can't do it for any distribution, because it'll then * We can't do it for any distribution, because it'll then
@ -1931,7 +1931,7 @@ static void sphclassical_density_accum_cb(void *userdata,
return; return;
} }
/* Smoothing factor. Utilize the Wendland kernel. gnuplot: /* Smoothing factor. Utilize the Wendland kernel. `gnuplot`:
* q1(x) = (2.0 - x)**4 * ( 1.0 + 2.0 * x) * q1(x) = (2.0 - x)**4 * ( 1.0 + 2.0 * x)
* plot [0:2] q1(x) */ * plot [0:2] q1(x) */
q = qfac / pow3f(pfr->h) * pow4f(2.0f - rij_h) * (1.0f + 2.0f * rij_h); q = qfac / pow3f(pfr->h) * pow4f(2.0f - rij_h) * (1.0f + 2.0f * rij_h);
@ -2021,7 +2021,7 @@ static void sphclassical_force_cb(void *sphdata_v,
NULL, psys, state->co, &pfr, interaction_radius, sphclassical_neighbor_accum_cb); NULL, psys, state->co, &pfr, interaction_radius, sphclassical_neighbor_accum_cb);
pressure = stiffness * (pow7f(pa->sphdensity / rest_density) - 1.0f); pressure = stiffness * (pow7f(pa->sphdensity / rest_density) - 1.0f);
/* multiply by mass so that we return a force, not accel */ /* Multiply by mass so that we return a force, not acceleration. */
qfac2 *= sphdata->mass / pow3f(pfr.h); qfac2 *= sphdata->mass / pow3f(pfr.h);
pfn = pfr.neighbors; pfn = pfr.neighbors;
@ -2047,7 +2047,7 @@ static void sphclassical_force_cb(void *sphdata_v,
npressure = stiffness * (pow7f(npa->sphdensity / rest_density) - 1.0f); npressure = stiffness * (pow7f(npa->sphdensity / rest_density) - 1.0f);
/* First derivative of smoothing factor. Utilize the Wendland kernel. /* First derivative of smoothing factor. Utilize the Wendland kernel.
* gnuplot: * `gnuplot`:
* q2(x) = 2.0 * (2.0 - x)**4 - 4.0 * (2.0 - x)**3 * (1.0 + 2.0 * x) * q2(x) = 2.0 * (2.0 - x)**4 - 4.0 * (2.0 - x)**3 * (1.0 + 2.0 * x)
* plot [0:2] q2(x) * plot [0:2] q2(x)
* Particles > 2h away are excluded above. */ * Particles > 2h away are excluded above. */
@ -2438,15 +2438,17 @@ static float nr_distance_to_vert(float *p,
{ {
return len_v3v3(p, pce->x0) - radius; return len_v3v3(p, pce->x0) - radius;
} }
/**
* \param t: is the current time for newton rhapson.
* \param fac: is the starting factor for current collision iteration.
* \param col: The particle collision, `col->fac's` are factors for the
* particle sub-frame step start and end during collision modifier step.
*/
static void collision_interpolate_element(ParticleCollisionElement *pce, static void collision_interpolate_element(ParticleCollisionElement *pce,
float t, float t,
float fac, float fac,
ParticleCollision *col) ParticleCollision *col)
{ {
/* t is the current time for newton rhapson */
/* fac is the starting factor for current collision iteration */
/* The col->fac's are factors for the particle subframe step start
* and end during collision modifier step. */
float f = fac + t * (1.0f - fac); float f = fac + t * (1.0f - fac);
float mul = col->fac1 + f * (col->fac2 - col->fac1); float mul = col->fac1 + f * (col->fac2 - col->fac1);
if (pce->tot > 0) { if (pce->tot > 0) {
@ -3598,19 +3600,21 @@ static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra))
psys_sim_data_free(sim); psys_sim_data_free(sim);
} }
/* Code for an adaptive time step based on the Courant-Friedrichs-Lewy /** Code for an adaptive time step based on the Courant-Friedrichs-Lewy condition. */
* condition. */
static const float MIN_TIMESTEP = 1.0f / 101.0f; static const float MIN_TIMESTEP = 1.0f / 101.0f;
/* Tolerance of 1.5 means the last subframe neither favors growing nor /**
* shrinking (e.g if it were 1.3, the last subframe would tend to be too * Tolerance of 1.5 means the last sub-frame neither favors growing nor shrinking
* small). */ * (e.g if it were 1.3, the last sub-frame would tend to be too small).
*/
static const float TIMESTEP_EXPANSION_FACTOR = 0.1f; static const float TIMESTEP_EXPANSION_FACTOR = 0.1f;
static const float TIMESTEP_EXPANSION_TOLERANCE = 1.5f; static const float TIMESTEP_EXPANSION_TOLERANCE = 1.5f;
/* Calculate the speed of the particle relative to the local scale of the /**
* Calculate the speed of the particle relative to the local scale of the
* simulation. This should be called once per particle during a simulation * simulation. This should be called once per particle during a simulation
* step, after the velocity has been updated. element_size defines the scale of * step, after the velocity has been updated. element_size defines the scale of
* the simulation, and is typically the distance to neighboring particles. */ * the simulation, and is typically the distance to neighboring particles.
*/
static void update_courant_num( static void update_courant_num(
ParticleSimulationData *sim, ParticleData *pa, float dtime, SPHData *sphdata, SpinLock *spin) ParticleSimulationData *sim, ParticleData *pa, float dtime, SPHData *sphdata, SpinLock *spin)
{ {

View File

@ -449,7 +449,7 @@ void ShadowDirectional::cascade_tilemaps_distribution(Light &light, const Camera
} }
/************************************************************************ /************************************************************************
* Clipmap Distribution * * Clip-map Distribution *
************************************************************************/ ************************************************************************/
IndexRange ShadowDirectional::clipmap_level_range(const Camera &camera) IndexRange ShadowDirectional::clipmap_level_range(const Camera &camera)
@ -593,7 +593,7 @@ void ShadowDirectional::end_sync(Light &light, const Camera &camera, float lod_b
for (int64_t i = 0; i < before_range; i++) { for (int64_t i = 0; i < before_range; i++) {
tilemaps_.append(tilemap_pool.acquire()); tilemaps_.append(tilemap_pool.acquire());
} }
/* Keep cached lods. */ /* Keep cached LOD's. */
tilemaps_.extend(cached_tilemaps); tilemaps_.extend(cached_tilemaps);
for (int64_t i = 0; i < after_range; i++) { for (int64_t i = 0; i < after_range; i++) {
tilemaps_.append(tilemap_pool.acquire()); tilemaps_.append(tilemap_pool.acquire());

View File

@ -268,7 +268,7 @@ class ShadowModule {
/** \name Debugging /** \name Debugging
* \{ */ * \{ */
/** Display informations about the virtual shadows. */ /** Display information about the virtual shadows. */
PassSimple debug_draw_ps_ = {"Shadow.Debug"}; PassSimple debug_draw_ps_ = {"Shadow.Debug"};
/** \} */ /** \} */

View File

@ -150,7 +150,7 @@ bool select_pick(const ViewContext &vc,
const int2 mval); const int2 mval);
/** /**
* Select points or curves in a (screenspace) rectangle. * Select points or curves in a (screen-space) rectangle.
*/ */
bool select_box(const ViewContext &vc, bool select_box(const ViewContext &vc,
bke::CurvesGeometry &curves, bke::CurvesGeometry &curves,

View File

@ -21,7 +21,7 @@ static void node_declare(NodeDeclarationBuilder &b)
.description(N_("Index of the face group inside each boundary edge region")); .description(N_("Index of the face group inside each boundary edge region"));
} }
/* Join all uinque unordered combinations of indices. */ /** Join all unique unordered combinations of indices. */
static void join_indices(AtomicDisjointSet &set, const Span<int> indices) static void join_indices(AtomicDisjointSet &set, const Span<int> indices)
{ {
for (const int i : indices.index_range()) { for (const int i : indices.index_range()) {