Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
unit_physics.h File Reference
#include "gfx/mesh.h"
#include "unit.h"
#include "lin_time.h"
#include "beam.h"
#include "planet.h"
#include "audiolib.h"
#include "configxml.h"
#include "vs_globals.h"
#include "gfx/cockpit.h"
#include "unit_util.h"
#include "universe_util.h"
#include "cmd/script/mission.h"
#include "networking/lowlevel/vsnet_clientstate.h"
#include "networking/netclient.h"

Go to the source code of this file.

Functions

float copysign (float x, float y)
 
unsigned int apply_float_to_unsigned_int (float tmp)
 

Function Documentation

unsigned int apply_float_to_unsigned_int ( float  tmp)

Definition at line 649 of file unit_generic.cpp.

References int.

650 {
651  static unsigned long int seed = 2531011;
652  seed += 214013;
653  seed %= 4294967295u;
654  unsigned int ans = (unsigned int) tmp;
655  tmp -= ans; //now we have decimal;
656  if ( seed < (unsigned long int) (4294967295u*tmp) )
657  ans += 1;
658  return ans;
659 }
float copysign ( float  x,
float  y 
)

Definition at line 633 of file unit_generic.cpp.

634 {
635  if (y > 0)
636  return x;
637  else
638  return -x;
639 }