.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 1 SDK (http://forums.bots-united.com/forumdisplay.php?f=33)
-   -   v_angle.y is always 0 ??? (http://forums.bots-united.com/showthread.php?t=3644)

koraX 25-02-2005 14:07

Re: v_angle.y is always 0 ???
 
Quote:

Just substract -180 from the y and z angle and wrap them with something like this:
Code:

float WrapYZAngle(float angle)
{
    while (angle >= 360.0f) angle -= 360.0f;
    while (angle < 0.0f) angle += 360.0f;
    return angle;
}


bad solution, if angle is big number, subtracting 360 won't help and you have deadlock.

http://wiki.bots-united.com/index.ph...Angle_facility

And for austin, all about angles

Pierre-Marie Baty 25-02-2005 14:25

Re: v_angle.y is always 0 ???
 
good, KoraX ;)
Feed our wiki, guys, feed our wiki :)

Rick 25-02-2005 16:17

Re: v_angle.y is always 0 ???
 
Quote:

Originally Posted by koraX
bad solution, if angle is big number, subtracting 360 won't help and you have deadlock.

http://wiki.bots-united.com/index.ph...Angle_facility

And for austin, all about angles

Heh I just copied that code from Cube :-\ Something is wrong if you have very big numbers anyway...
But I like your macros, going to use that :)

stefanhendriks 25-02-2005 16:24

Re: v_angle.y is always 0 ???
 
Quote:

Originally Posted by Austin
Da! -DAAAAAhh!!!
Ok can I say it was REALLY late last night!
Noooo. please wipe delete this msg from the server!...
Ashamed, yes, totally shamed... Balaaagg...

But even so you wouldn't think the implicit cast would work that way now do ya...


Either give me a compile warning, or do a "reasonable" cast ok?

tx. everyone.

perhaps you could turn up your warning level of y our compiler? I used to set the MSVC compiler on pretty high (level 4?) so it would complain about every 'conversion' i did with %d (and use floats, etc)...

Whistler 26-02-2005 06:48

Re: v_angle.y is always 0 ???
 
Quote:

perhaps you could turn up your warning level of y our compiler? I used to set the MSVC compiler on pretty high (level 4?) so it would complain about every 'conversion' i did with %d (and use floats, etc)...
then you will get a lot (really lot!) of warnings from Valve's code, Metamod code and STL files :) And that's actually why I 'stripped' all the external codes like Valve SDK and Metamod, only necessary part is left.

koraX 26-02-2005 09:51

Re: v_angle.y is always 0 ???
 
Quote:

Originally Posted by Whistler
then you will get a lot (really lot!) of warnings from Valve's code, Metamod code and STL files :) And that's actually why I 'stripped' all the external codes like Valve SDK and Metamod, only necessary part is left.

I heavily stripped metamod (into one file) because it collided with my code.
I also stripped SDK a lot.
I've got warning level 4, I'm using STL everywhere and get no warning. So it is possible :)

Austin 26-02-2005 20:22

Re: v_angle.y is always 0 ???
 
1) The reason I don't chagne my warning level is as you say, it generates too many warnings to be useful. You could use pragma warning but that is a hassle and probably not worth the effort except in certain cases.

2) By modify source from 3rd parties you get into a difficult situation.
What do you do when updates come out? You have to re-clean the 3rd party source. Time consuming and not fun. Perhaps it is ok with the hl1 sdk that doesn't change much if at all, but what about the new source sdk that is and will be changing "every time you logon to steam?..."

sfx1999 27-02-2005 01:39

Re: v_angle.y is always 0 ???
 
You could probably optimize that so if the loop goes five times, you would use modulus intead. It probably won't go five times anyway, but try it.


All times are GMT +2. The time now is 10:19.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.