Re: DT in BGT
Just out of curiosity and as a further effort to troubleshoot this, I created a totally separate tiny program with only the code for theta to see whether BGT would get it correct. Code is:
double theta;
double deg = 253;
const double pi = 3.14159265358979;
void main()
{
show_game_window("");
DTR(deg);
alert("", "Number of degrees is " + deg + ". Theta is " + theta + ". Cosine of theta is " + cosine(theta) + ". Sine of theta is " + sine(theta) + ".");
}
double DTR(double deg)
{
return theta = deg*pi/180;
}
It seems to work now. This is what it shows:
Number of degrees is 253. Theta is 4.41568300754565. Cosine of theta is -0.292371704722741. Sine of theta is -0.956304755963034.
That is correct. If I change the number of degrees to, say, 75, I get:
Number of degrees is 75. Theta is 1.30899693899575. Cosine of theta is 0.258819045102522. Sine of theta is 0.965925826289068.
I double checked with a calculator, and those are both correct.
UPDATE I think I may have stumbled across the issue. I put a log entry in every function where theta was used. It actually shows as correct in the check and move functions, but for some reason it's not actually performing the correct math on the vector. I used arbitrary numbers just for testing. Log shows:
In check function. Number of degrees is 253. Theta is 4.41568300754565. Cosine of theta is -0.292371704722741, and sine of theta is -0.956304755963034.
(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 1754.38598632813, velocity y is 0, and velocity z is -9.8100004196167.
Velocity Y should not be 0, and vel.x is wrong as well. My calculator says that (100/0.057), or (acc/M2) is 1754.385964912280. It shows vel.x as 1,754...so, it got that part right. However, the correct math is (acc/M2)*cosine(theta). So, (100/0.057)*-0.292371704722741, which does not equal 1,754. It equals -512.93281530305438596491228070175, according to my calculator. This means that for some reason it appears as though the part of the math "*cosine(theta)" is being ignored.
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector