return true;
}
-
/*
-================
-COM_CheckParm
+===============
+Com_CalcRoll
-Returns the position (1 to argc-1) in the program's argument list
-where the given parameter apears, or 0 if not present
-================
+Used by view and sv_user
+===============
*/
-int COM_CheckParm (const char *parm)
+float Com_CalcRoll (const vec3_t angles, const vec3_t velocity, const vec_t angleval, const vec_t velocityval)
{
- int i;
+ vec3_t right;
+ float sign;
+ float side;
- for (i=1 ; i<sys.argc ; i++)
- {
- if (!sys.argv[i])
- continue; // NEXTSTEP sometimes clears appkit vars.
- if (!strcmp (parm,sys.argv[i]))
- return i;
- }
+ AngleVectors (angles, NULL, right, NULL);
+ side = DotProduct (velocity, right);
+ sign = side < 0 ? -1 : 1;
+ side = fabs(side);
+
+ if (side < velocityval)
+ side = side * angleval / velocityval;
+ else
+ side = angleval;
+
+ return side*sign;
- return 0;
}
//===========================================================================