|
From: <gp...@ri...> - 2004-08-17 23:54:04
|
I recently ran a simulation that I haven't looked at for a while. It didn't run correctly: the physics was wrong. I can't be certain, but I think it was doing the right thing last time I looked at it. I'm trying to distill the program down to a small example that illustrates the problem. The problem is rather mischievous (or I'm missing something obvious) and attempts to write a small broken program haven't yet met with success. Nonetheless ... I discovered that if a replace the line FMass.v = FMass.v + (Fext / FMass.m)*dt with FMass.v += (Fext / FMass.m)*dt The behavior of the program changes. FMass is a sphere. FMass.v is a visual vector, FMass.m is a scalar. Fext is a vector. Did I miss something? Should I expect that "+=" will not increment a vector? Interactively, I *can* correctly increment a vector using "+=". While I'm trying to track down the problem and write a small example, I thought I'd check with the group for a sanity check. -gary |