Archived post by WhileRomeBurns

the other thing houdini does is accumulate air resistance and target velocity if you have 2 or more wind forces. the function to do that yourself: “`void addWindForce(vector targetv2; float airresist2; vector _targetv; float _airresist) {
float airresist_sum = _airresist + airresist2; _targetv = (_targetv * _airresist + targetv2 * airresist2) / airresist_sum; _airresist = airresist_sum; }“`

Archived post by WhileRomeBurns

if you want to use `targetv`, `airresist`, `drag` you could do the math yourself and store them in custom attributes like `@c_targetv` so bullet doesn’t pick um up and make nans

it’ll be something like this:

“`float imass = 1.0 / @mass;
@c_airresist = @c_airresist * @c_drag; if (@c_airresist > 0) {
    // the relative ang vel     v@v -= v@c_targetv;
    // quadratic drag     v@v *= 1.0 / ( (@c_airresist * imass * @TimeInc * length(v@v)) + 1.0 );
    // restore frame     v@v += v@c_targetv; }“`

i don’t see how that could produce a nan unless c_airresist was negative or mass was zero

which you can add checks for if you like

just skip zero-mass dudes

Archived post by CiaranM

It’s a SOP Solver, so just do your group masking the SOP way 🙂 Specifically, set the group mask on your wrangle nodes to @name=boxes* or @name=spheres*. You really only need a single SOP solver (with Data Name and Group back to default) with as much wrangling per-group as you like inside of it. I really like to keep it simple and keep all of my packed geometry coming from a single SOP source into a single RBD Packed Object. Do as much as you can with SOP-type workflows, avoiding DOP anachronisms at all costs.