[Closed] Script Controller Recursion/Storing Value
hi all
i’m making a car rig for car motion on the xy plane, so far i’ve completed more than half the way to it
i have the wheels roll right , front wheels’ steering angle influence the car orientation, car velocity influence the car position, the car position determines the wheels’ orientation and the car acceleration generates the body’s response suspension
MY PROBLEM IS
i use script controllers for almost all the controllers of the car chasis and wheels
the equtions i use for motion define changes in orintation and position of the wheels and chasis , which means they have to be incremented at every new frame to the value of the controller at the previous frame
to avoid self reference i call a recursive function which calculates the controller value at the previous frame , i calculate the change in position or orientation according to the current frame and add it to the result of the recursive call. this is the Cuneyt Ozdas way http://www.cuneytozdas.com/tutorials/maxscript/
instead of storing the value of the controller at the previous frame, we force it to be calculated incrementely starting from frame 0n then we add to it the changes calculated for the current frame
so far so good
what i have now is
each wheel’s rotation is calculated recursivley,
the car chasis orientation is calculated recursivley,so is its position AND its position depens on its orientation [color=red]so for every recursive call calculating position, a recursive call to calculate orientation is made, that is [/color]Nested Recursion which is excuted every frame within the time range and makes timesliding impossible
is there a way other than recursion calls to store previous script controller value and use it for the current frame calculation avoiding self reference
please help!