Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
Add rainStrength control pipe command
Browse files Browse the repository at this point in the history
This replicates the -rs command line argument as a control pipe command
so that the local rainfall rate can be changed in a running sandbox.

Because negative rain strength values are accepted, another way to use this
control pipe command is for local drain/evaporation.  That is, with a
positive rainStrength, an open hand gesture causes "water" to form in the
sandbox model.  But, with a negative rainStrength, an open hand gesture
removes water locally.

All "open hands" recognized by the sandbox are treated in the same
manner.  So, this addition does not allow some hands to rain and others
to evaporate, simultaneously.  With a way to toggle positive and negative
rainStrength values, spread-finger hands can be toggled between rain and
evaporation use.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
  • Loading branch information
skrobinson committed Aug 3, 2021
1 parent 392203b commit f5ff191
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sandbox.cpp
Expand Up @@ -1329,6 +1329,12 @@ void Sandbox::frame(void) {
} else {
std::cerr << "Wrong number of arguments for evaporationRate control pipe command" << std::endl;
}
} else if (isToken(tokens[0], "rainStrength")) {
if (tokens.size() == 2) {
rainStrength = GLfloat(atof(tokens[1].c_str()));
} else {
std::cerr << "Wrong number of arguments for rainStrength control pipe command" << std::endl;
}
} else {
std::cerr << "Unrecognized control pipe command " << tokens[0] << std::endl;
}
Expand Down

0 comments on commit f5ff191

Please sign in to comment.