Re: DT in BGT

Yeah, that's what I thought days ago, actually.  So I made a function that looks like this:
vector UpdateVel()
{
vel.x = (acc.x/M2)*cosine(theta);
vel.y = (acc.y/M2)*sine(theta);
vel.z = -9.81;
return vel;
}
Then, apparently I forgot to place it in the check function, like a damn idiot.  No wonder it never worked.  So I just placed it in the check function before moving the ball, and now it works correctly:
In move function.  Number of degrees is 253, theta is 4.41568300754565, cosine of theta is -0.292371704722741, sine of theta is -0.956304755963034, accelleration x is 100, accelleration y is 100, mass is 0.057000000029802.  Velocity x is -512.932800292969, velocity y is -1677.72766113281, and velocity z is -9.8100004196167.
Ball is now at -10.2586555480957, -33.5545539855957, 499.803802490234.
It appears to be seeing it correctly, but to be thorough, as a further test, I changed degrees to 45, which should be a 1:1 ratio on x and y.  And that appears to work as well:
In move function.  Number of degrees is 45, theta is 0.785398163397448, cosine of theta is 0.707106781186548, sine of theta is 0.707106781186547, accelleration x is 100, accelleration y is 100, mass is 0.057000000029802.  Velocity x is 1240.53820800781, velocity y is 1240.53820800781, and velocity z is -9.8100004196167.
Ball is now at 24.8107643127441, 24.8107643127441, 499.803802490234.
Finally!  For the record, I feel like a total fucking idiot, because I suspected that this was the issue, then wrote the function above, only to forget to add it to the check function.  And when it didn't work, I assumed my first suspicion was wrong, when it actually wasn't.  I really feel like a damn moron.  Here's the question, though.  I really, really would prefer not to write functions to update each vector like that.  Is there a way to write a generic function that will update any vector I choose?  That way I don't need to write one for velocity, one for drag, one for acceleration, etc.  Again, I cannot believe how stupid I feel at the moment.  Wow.  Just...wow.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector

Reply via email to