Cleanup: use const pointer for the gravity vector
This commit is contained in:
@@ -89,7 +89,10 @@ typedef struct SPHData {
|
||||
ParticleData *pa;
|
||||
float mass;
|
||||
std::optional<blender::Map<blender::OrderedEdge, int>> eh;
|
||||
float *gravity;
|
||||
|
||||
/** The gravity as a `float[3]`, may also be null when the simulation doesn't use gravity. */
|
||||
const float *gravity;
|
||||
|
||||
float hfac;
|
||||
/* Average distance to neighbors (other particles in the support domain),
|
||||
* for calculating the Courant number (adaptive time step). */
|
||||
|
||||
@@ -1795,7 +1795,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
|
||||
ParticleSpring *spring = nullptr;
|
||||
SPHRangeData pfr;
|
||||
SPHNeighbor *pfn;
|
||||
float *gravity = sphdata->gravity;
|
||||
const float *gravity = sphdata->gravity;
|
||||
const std::optional<blender::Map<blender::OrderedEdge, int>> &springhash = sphdata->eh;
|
||||
|
||||
float q, u, rij, dv[3];
|
||||
@@ -1996,7 +1996,7 @@ static void sphclassical_force_cb(void *sphdata_v,
|
||||
SPHFluidSettings *fluid = psys[0]->part->fluid;
|
||||
SPHRangeData pfr;
|
||||
SPHNeighbor *pfn;
|
||||
float *gravity = sphdata->gravity;
|
||||
const float *gravity = sphdata->gravity;
|
||||
|
||||
float dq, u, rij, dv[3];
|
||||
float pressure, npressure;
|
||||
|
||||
Reference in New Issue
Block a user