[Bf-blender-cvs] [c5744593ec4] functions: rename pindex_of to get_particle_index

Jacques Lucke noreply at git.blender.org
Mon Jun 24 12:38:11 CEST 2019


Commit: c5744593ec42f86ee449c1fd95f25dde3a952ff3
Author: Jacques Lucke
Date:   Mon Jun 24 09:40:51 2019 +0200
Branches: functions
https://developer.blender.org/rBc5744593ec42f86ee449c1fd95f25dde3a952ff3

rename pindex_of to get_particle_index

===================================================================

M	source/blender/simulations/bparticles/core.hpp
M	source/blender/simulations/bparticles/events.cpp
M	source/blender/simulations/bparticles/forces.cpp
M	source/blender/simulations/bparticles/simulate.cpp

===================================================================

diff --git a/source/blender/simulations/bparticles/core.hpp b/source/blender/simulations/bparticles/core.hpp
index 6a023b2aad7..42070819b24 100644
--- a/source/blender/simulations/bparticles/core.hpp
+++ b/source/blender/simulations/bparticles/core.hpp
@@ -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];
   }
diff --git a/source/blender/simulations/bparticles/events.cpp b/source/blender/simulations/bparticles/events.cpp
index 073e5561573..cbe0f41479a 100644
--- a/source/blender/simulations/bparticles/events.cpp
+++ b/source/blender/simulations/bparticles/events.cpp
@@ -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]);
diff --git a/source/blender/simulations/bparticles/forces.cpp b/source/blender/simulations/bparticles/forces.cpp
index a5813a43a99..9ff3f1c8318 100644
--- a/source/blender/simulations/bparticles/forces.cpp
+++ b/source/blender/simulations/bparticles/forces.cpp
@@ -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);
diff --git a/source/blender/simulations/bparticles/simulate.cpp b/source/blender/simulations/bparticles/simulate.cpp
index eb229a82eef..300993e7223 100644
--- a/source/blender/simulations/bparticles/simulate.cpp
+++ b/source/blender/simulations/bparticles/simulate.cpp
@@ -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];



More information about the Bf-blender-cvs mailing list