Re: DT in BGT
UPDATE: Adding 180 degrees and recalculating theta mirrors the angle correctly:
B.pos.z = 50;
deg += 180;
//recalculate theta.
DTR(deg);
B.moving = true;
move();
And the previous movement is mirrored. I do notice that apparently as height lowers, it never equals 0, because the block of code that starts:
if(B.z == 0)
never executes, and when I check after a while, B.z is way, way less than 0, like negative 35 or so. So I changed it to:
if(B.z <= 0)
and then it works, but a lot of the time it waits until it is negative before executing. So I had to say:
if(B.z <= 0)
B.z = 0;
I don't understand why Z is never just 0. Theoretically, as the ball travels, z has to hit exactly 0 at some point, and when that happens, the line if(B.z == 0) should execute. Changing it to:
if(B.z <= 0)
does allow the ball to stop. One other thing I do notice that quite frankly royally pisses me off is that when mirroring, the ball doesn't land where it started. In other words, ball starts at position 0, 0, 50. After travelling at 45 degrees, it lands at 31.0134830474854, 31.0134830474854, 0. After mirroring, which should bring it right back to where it was on x and y, at 0, 0, it shows that ball lands at 0.248107805848122, 0.248107805848122, 0. Why the discrepancy? Shouldn't it travel the same exact distance on each side? Numbers are immutable, as is the math done upon those numbers. 2 plus 2 will always be four, 2 times 2 will always be 8, and so on. I don't understand the discrepancy here, since the only thing that I did was exactly mirror the previous shot, with no other changes. It should be like driving a car to the store down the street, then back home, the same distance for both, right? These sort of discrepancies are what cause the problem I have that has forced me to entirely rewrite this code in the first fucking place. I thought that using vectors and applying actual immutable math equations to this would stop this sort of shit. So what the fuck is causing the discrepancy now?
UPDATE 2: I ran the test 5 times, and the numbers for x and y came out exactly the same each time. Before I move, I set degrees to 45. Starting cords for the vector position of the ball are x at 0, y at 0, and z, for height, at 50. Degrees set to 45, and the test commences. Endin position is x at 31.0134830474854, y at 31.0134830474854, z at 0. When mirroring, z is set back to 50, and the return begins. However, the position ends with x at 0.248107805848122, y at 0.248107805848122, and z at 0. So at least the discrepancy itself is a constant one. In five tests, those coordinates matched exactly all 5 times. Theoretically, though, shouldn't the ball return to exactly 0 x and 0 y where it started? There shouldn't be any discrepancy, given that height was set to exactly the same in both cases, right? Math doesn't change, and neither does distance. if distance A = 5, then if distance b is a mirror of a, it should equal 5 as well, right?
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector