Page 1 of 1

user int variable at state and reading previous value

Posted: Sat Jul 10, 2021 1:05 am
by ostr1969
i need to add some int variable to the state, it counts the times other variable is passing zero.
at my custom force I need to read the previous value and add 1 to it on some condition.
1. how can i set discreet var and change its value ?
2. how can i get to the previous state var inside computeForce(const SimTK::State& s..... ?