Permalink
Browse files

pavg0 / pavg1 properties can be set through the console and prop

  • Loading branch information...
jacob1 committed Oct 26, 2014
1 parent 7582acf commit ca0eecee808238980e4606390eb4c549d9f1fe2b
Showing with 14 additions and 0 deletions.
  1. +6 −0 src/lua/CommandInterface.cpp
  2. +6 −0 src/lua/LegacyLuaAPI.cpp
  3. +2 −0 src/simulation/Particle.cpp
@@ -74,6 +74,12 @@ int CommandInterface::GetPropertyOffset(std::string key_, FormatType & format)
} else if (strcmp(key, "dcolor")==0){
offset = offsetof(Particle, dcolour);
format = FormatInt;
} else if (!strcmp(key, "pavg0")){
offset = offsetof(Particle, pavg[0]);
format = FormatFloat;
} else if (!strcmp(key, "pavg1")){
offset = offsetof(Particle, pavg[1]);
format = FormatFloat;
} else {
offset = -1;
}
@@ -146,6 +146,12 @@ int luacon_particle_getproperty(const char * key, int * format)
} else if (!strcmp(key, "dcolor")) {
offset = offsetof(Particle, dcolour);
*format = 0;
} else if (!strcmp(key, "pavg0")) {
offset = offsetof(Particle, pavg[0]);
*format = 1;
} else if (!strcmp(key, "pavg1")) {
offset = offsetof(Particle, pavg[1]);
*format = 1;
} else {
offset = -1;
}
@@ -16,5 +16,7 @@ std::vector<StructProperty> Particle::GetProperties()
properties.push_back(StructProperty("tmp", StructProperty::Integer, offsetof(Particle, tmp)));
properties.push_back(StructProperty("tmp2", StructProperty::Integer, offsetof(Particle, tmp2)));
properties.push_back(StructProperty("dcolour", StructProperty::UInteger, offsetof(Particle, dcolour)));
properties.push_back(StructProperty("pavg0", StructProperty::Float, offsetof(Particle, pavg[0])));
properties.push_back(StructProperty("pavg1", StructProperty::Float, offsetof(Particle, pavg[1])));
return properties;
}

0 comments on commit ca0eece

Please sign in to comment.