rename pindex_of to get_particle_index
This commit is contained in:
@@ -51,7 +51,7 @@ struct ParticleSet {
|
||||
return m_particle_indices;
|
||||
}
|
||||
|
||||
uint pindex_of(uint i)
|
||||
uint get_particle_index(uint i)
|
||||
{
|
||||
return m_particle_indices[i];
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ class AgeReachedEvent : public Event {
|
||||
auto birth_times = particles.attributes().get_float("Birth Time");
|
||||
|
||||
for (uint i : particles.range()) {
|
||||
uint pindex = particles.pindex_of(i);
|
||||
uint pindex = particles.get_particle_index(i);
|
||||
float duration = durations[i];
|
||||
float birth_time = birth_times[pindex];
|
||||
float age = end_time - birth_time;
|
||||
@@ -60,7 +60,7 @@ class MeshCollisionEvent : public Event {
|
||||
auto position_offsets = ideal_offsets.position_offsets;
|
||||
|
||||
for (uint i : particles.range()) {
|
||||
uint pindex = particles.pindex_of(i);
|
||||
uint pindex = particles.get_particle_index(i);
|
||||
|
||||
float3 start_position = m_ray_transform.transform_position(positions[pindex]);
|
||||
float3 direction = m_ray_transform.transform_direction(position_offsets[i]);
|
||||
|
@@ -34,7 +34,7 @@ class TurbulenceForce : public BParticles::Force {
|
||||
{
|
||||
auto positions = particles.attributes().get_float3("Position");
|
||||
for (uint i : particles.indices()) {
|
||||
uint pindex = particles.pindex_of(i);
|
||||
uint pindex = particles.get_particle_index(i);
|
||||
|
||||
float3 pos = positions[pindex];
|
||||
float value = BLI_hnoise(0.5f, pos.x, pos.y, pos.z);
|
||||
|
@@ -66,7 +66,7 @@ BLI_NOINLINE static void forward_particles_to_next_event(
|
||||
auto velocities = particles.attributes().get_float3("Velocity");
|
||||
|
||||
for (uint i : particles.range()) {
|
||||
uint pindex = particles.pindex_of(i);
|
||||
uint pindex = particles.get_particle_index(i);
|
||||
float time_factor = time_factors_to_next_event[i];
|
||||
positions[pindex] += time_factor * ideal_offsets.position_offsets[i];
|
||||
velocities[pindex] += time_factor * ideal_offsets.velocity_offsets[i];
|
||||
@@ -153,7 +153,7 @@ BLI_NOINLINE static void compute_ideal_attribute_offsets(ParticleSet particles,
|
||||
auto velocities = particles.attributes().get_float3("Velocity");
|
||||
|
||||
for (uint i : particles.range()) {
|
||||
uint pindex = particles.pindex_of(i);
|
||||
uint pindex = particles.get_particle_index(i);
|
||||
|
||||
float mass = 1.0f;
|
||||
float duration = durations[i];
|
||||
@@ -262,7 +262,7 @@ BLI_NOINLINE static void simulate_ignoring_events(ParticleSet particles,
|
||||
auto velocities = particles.attributes().get_float3("Velocity");
|
||||
|
||||
for (uint i : particles.indices()) {
|
||||
uint pindex = particles.pindex_of(i);
|
||||
uint pindex = particles.get_particle_index(i);
|
||||
|
||||
positions[pindex] += offsets.position_offsets[i];
|
||||
velocities[pindex] += offsets.velocity_offsets[i];
|
||||
|
Reference in New Issue
Block a user