Re: Updated includes for BGT (includes bgt2py and 1st person sound pool)

If you're referring to the sin / cos arrays in math.bgt, those were an attempt at optimizing for speed. It turned out, after testing, that this was somehow slower than the built-in functions, I think because CPUs started doing this optimization in hardware. So you can ignore those and use the normal sine / cosine functions.
I'm using the coordinate system found in most 3d engines, where +x is right, +y is up, and +z is out from the screen toward the viewer. At least, that's how it's supposed to work. So x=cos (theta) * cos (phi), y=sin (phi), z = sin (theta) * cos (phi). I'm pretty sure something in fpsound_pool gets that wrong, somewhere, though.
Theta and phi are radians. I didn't include any handling for degrees.

Also, BGT's vectors allow you to put the example for getting r into a single statement:
double r = (v2-v1).length();
BGT's vector operations are so convenient and simple to implement that I was surprised when I realized how few times I've seen anything similar elsewhere. Still needs negation and normalization, though. -v won't compile, and without a function for normalizing, you'd have to have divide by 0 checks everywhere.

-- 
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 : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : mahdi-abedi 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 : 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

Reply via email to