[Bf-blender-cvs] [f77dfe6e947] functions: cleanup: rename to attribute_offsets
Jacques Lucke
noreply at git.blender.org
Sat Jun 29 16:25:47 CEST 2019
Commit: f77dfe6e947bb5a28f628e5884189a1e78f272bb
Author: Jacques Lucke
Date: Sat Jun 29 13:48:59 2019 +0200
Branches: functions
https://developer.blender.org/rBf77dfe6e947bb5a28f628e5884189a1e78f272bb
cleanup: rename to attribute_offsets
===================================================================
M source/blender/simulations/bparticles/c_wrapper.cpp
M source/blender/simulations/bparticles/core.hpp
M source/blender/simulations/bparticles/events.cpp
M source/blender/simulations/bparticles/simulate.cpp
===================================================================
diff --git a/source/blender/simulations/bparticles/c_wrapper.cpp b/source/blender/simulations/bparticles/c_wrapper.cpp
index d26d46f25ff..74e947983da 100644
--- a/source/blender/simulations/bparticles/c_wrapper.cpp
+++ b/source/blender/simulations/bparticles/c_wrapper.cpp
@@ -56,12 +56,12 @@ void BParticles_state_free(BParticlesState state)
class EulerIntegrator : public Integrator {
private:
- AttributesInfo m_integrated_attributes_info;
+ AttributesInfo m_offset_attributes_info;
public:
SmallVector<Force *> m_forces;
- EulerIntegrator() : m_integrated_attributes_info({}, {}, {"Position", "Velocity"})
+ EulerIntegrator() : m_offset_attributes_info({}, {}, {"Position", "Velocity"})
{
}
@@ -72,17 +72,17 @@ class EulerIntegrator : public Integrator {
}
}
- AttributesInfo &integrated_attributes_info() override
+ AttributesInfo &offset_attributes_info() override
{
- return m_integrated_attributes_info;
+ return m_offset_attributes_info;
}
void integrate(ParticlesBlock &block,
ArrayRef<float> durations,
- AttributeArrays r_values) override
+ AttributeArrays r_offsets) override
{
uint amount = block.active_amount();
- BLI_assert(amount == r_values.size());
+ BLI_assert(amount == r_offsets.size());
SmallVector<float3> combined_force(amount);
combined_force.fill({0, 0, 0});
@@ -93,8 +93,8 @@ class EulerIntegrator : public Integrator {
auto last_velocities = block.slice_active().get_float3("Velocity");
- auto position_offsets = r_values.get_float3("Position");
- auto velocity_offsets = r_values.get_float3("Velocity");
+ auto position_offsets = r_offsets.get_float3("Position");
+ auto velocity_offsets = r_offsets.get_float3("Velocity");
for (uint pindex = 0; pindex < amount; pindex++) {
float mass = 1.0f;
diff --git a/source/blender/simulations/bparticles/core.hpp b/source/blender/simulations/bparticles/core.hpp
index 6549a3363ea..fd19d64c282 100644
--- a/source/blender/simulations/bparticles/core.hpp
+++ b/source/blender/simulations/bparticles/core.hpp
@@ -271,7 +271,7 @@ class Force {
class EventInterface {
private:
ParticleSet m_particles;
- AttributeArrays &m_integrated_attributes;
+ AttributeArrays &m_attribute_offsets;
ArrayRef<float> m_durations;
float m_end_time;
@@ -280,13 +280,13 @@ class EventInterface {
public:
EventInterface(ParticleSet particles,
- AttributeArrays &integrated_attributes,
+ AttributeArrays &attribute_offsets,
ArrayRef<float> durations,
float end_time,
SmallVector<uint> &r_filtered_indices,
SmallVector<float> &r_filtered_time_factors)
: m_particles(particles),
- m_integrated_attributes(integrated_attributes),
+ m_attribute_offsets(attribute_offsets),
m_durations(durations),
m_end_time(end_time),
m_filtered_indices(r_filtered_indices),
@@ -310,9 +310,9 @@ class EventInterface {
return TimeSpan(m_end_time - duration, duration);
}
- AttributeArrays integrated_attributes()
+ AttributeArrays attribute_offsets()
{
- return m_integrated_attributes;
+ return m_attribute_offsets;
}
float end_time()
@@ -403,11 +403,11 @@ class Integrator {
public:
virtual ~Integrator();
- virtual AttributesInfo &integrated_attributes_info() = 0;
+ virtual AttributesInfo &offset_attributes_info() = 0;
virtual void integrate(ParticlesBlock &block,
ArrayRef<float> durations,
- AttributeArrays r_values) = 0;
+ AttributeArrays r_offsets) = 0;
};
class ParticleType {
diff --git a/source/blender/simulations/bparticles/events.cpp b/source/blender/simulations/bparticles/events.cpp
index ca531adad28..db29f633865 100644
--- a/source/blender/simulations/bparticles/events.cpp
+++ b/source/blender/simulations/bparticles/events.cpp
@@ -49,7 +49,7 @@ class MeshCollisionEvent : public Event {
{
ParticleSet &particles = interface.particles();
auto positions = particles.attributes().get_float3("Position");
- auto position_offsets = interface.integrated_attributes().get_float3("Position");
+ auto position_offsets = interface.attribute_offsets().get_float3("Position");
for (uint i : particles.range()) {
uint pindex = particles.get_particle_index(i);
diff --git a/source/blender/simulations/bparticles/simulate.cpp b/source/blender/simulations/bparticles/simulate.cpp
index eee4d59f46e..d82f57f7c22 100644
--- a/source/blender/simulations/bparticles/simulate.cpp
+++ b/source/blender/simulations/bparticles/simulate.cpp
@@ -33,7 +33,7 @@ static ArrayRef<uint> static_number_range_ref(Range<uint> range)
**************************************************/
BLI_NOINLINE static void find_next_event_per_particle(ParticleSet particles,
- AttributeArrays &integrated_attributes,
+ AttributeArrays &attribute_offsets,
ArrayRef<float> durations,
float end_time,
ArrayRef<Event *> events,
@@ -51,7 +51,7 @@ BLI_NOINLINE static void find_next_event_per_particle(ParticleSet particles,
Event *event = events[event_index];
EventInterface interface(particles,
- integrated_attributes,
+ attribute_offsets,
durations,
end_time,
triggered_indices,
@@ -83,14 +83,14 @@ BLI_NOINLINE static void find_next_event_per_particle(ParticleSet particles,
BLI_NOINLINE static void forward_particles_to_next_event_or_end(
ParticleSet particles,
- AttributeArrays integrated_attributes,
+ AttributeArrays attribute_offsets,
ArrayRef<float> time_factors_to_next_event)
{
auto positions = particles.attributes().get_float3("Position");
auto velocities = particles.attributes().get_float3("Velocity");
- auto position_offsets = integrated_attributes.get_float3("Position");
- auto velocity_offsets = integrated_attributes.get_float3("Velocity");
+ auto position_offsets = attribute_offsets.get_float3("Position");
+ auto velocity_offsets = attribute_offsets.get_float3("Velocity");
for (uint i : particles.range()) {
uint pindex = particles.get_particle_index(i);
@@ -103,10 +103,10 @@ BLI_NOINLINE static void forward_particles_to_next_event_or_end(
BLI_NOINLINE static void update_ideal_offsets_for_particles_with_events(
ParticleSet particles_with_events,
ArrayRef<float> time_factors_to_next_event,
- AttributeArrays integrated_attributes)
+ AttributeArrays attribute_offsets)
{
- auto position_offsets = integrated_attributes.get_float3("Position");
- auto velocity_offsets = integrated_attributes.get_float3("Velocity");
+ auto position_offsets = attribute_offsets.get_float3("Position");
+ auto velocity_offsets = attribute_offsets.get_float3("Velocity");
for (uint i : particles_with_events.range()) {
uint pindex = particles_with_events.get_particle_index(i);
@@ -196,7 +196,7 @@ BLI_NOINLINE static void run_actions(BlockAllocator &block_allocator,
BLI_NOINLINE static void simulate_to_next_event(BlockAllocator &block_allocator,
ParticleSet particles,
- AttributeArrays integrated_attributes,
+ AttributeArrays attribute_offsets,
ArrayRef<float> durations,
float end_time,
ParticleType &particle_type,
@@ -209,7 +209,7 @@ BLI_NOINLINE static void simulate_to_next_event(BlockAllocator &block_allocator,
SmallVector<uint> indices_with_event;
find_next_event_per_particle(particles,
- integrated_attributes,
+ attribute_offsets,
durations,
end_time,
particle_type.events(),
@@ -218,8 +218,7 @@ BLI_NOINLINE static void simulate_to_next_event(BlockAllocator &block_allocator,
time_factors_to_next_event,
indices_with_event);
- forward_particles_to_next_event_or_end(
- particles, integrated_attributes, time_factors_to_next_event);
+ forward_particles_to_next_event_or_end(particles, attribute_offsets, time_factors_to_next_event);
SmallVector<uint> particle_indices_with_event(indices_with_event.size());
for (uint i = 0; i < indices_with_event.size(); i++) {
@@ -228,7 +227,7 @@ BLI_NOINLINE static void simulate_to_next_event(BlockAllocator &block_allocator,
ParticleSet particles_with_events(particles.block(), particle_indices_with_event);
update_ideal_offsets_for_particles_with_events(
- particles_with_events, time_factors_to_next_event, integrated_attributes);
+ particles_with_events, time_factors_to_next_event, attribute_offsets);
SmallVector<SmallVector<uint>> particles_per_event(particle_type.events().size());
find_particle_indices_per_event(
@@ -262,7 +261,7 @@ BLI_NOINLINE static void simulate_with_max_n_events(
uint max_events,
BlockAllocator &block_allocator,
ParticlesBlock &block,
- AttributeArrays integrated_attributes,
+ AttributeArrays attribute_offsets,
ArrayRef<float> durations,
float end_time,
ParticleType &particle_type,
@@ -277,7 +276,7 @@ BLI_NOINLINE static void simulate_with_max_n_events(
simulate_to_next_event(block_allocator,
particles_to_simulate,
- integrated_attributes,
+ attribute_offsets,
durations,
end_time,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list