1. package Physics is 
  2.  
  3.     pragma Pure; 
  4.  
  5.     type Clip_Type is ( 
  6.         Passive, 
  7.         OneWay, 
  8.         Wall, 
  9.  
  10.         Slope_45_Up_Floor,   Slope_45_Up_Ceiling, 
  11.         Slope_45_Down_Floor, Slope_45_Down_Ceiling, 
  12.  
  13.         Slope_22_Up_Floor_Thin,   Slope_22_Up_Floor_Wide, 
  14.         Slope_22_Up_Ceiling_Wide, Slope_22_Up_Ceiling_Thin, 
  15.  
  16.         Slope_22_Down_Floor_Wide,   Slope_22_Down_Floor_Thin, 
  17.         Slope_22_Down_Ceiling_Thin, Slope_22_Down_Ceiling_Wide 
  18.     ); 
  19.  
  20.     -- Combines two Clip_Type values and returns the most occlusive one. 
  21.     function "or"( l, r : Clip_Type ) return Clip_Type; 
  22.  
  23.     -- Clips a point to a tile as though the point is moving in the downward 
  24.     -- direction. The amount which the point should be adjusted upward is 
  25.     -- returned in 'adjustY'. 'size' is the size of the tile in pixels and 
  26.     -- 'x', 'y' is the point's location within the area of the tile. 'x' and 'y' 
  27.     -- must be in the range of 0..size-1. 
  28.     -- 
  29.     -- clip    : the clipping type of the tile 
  30.     -- size    : the width/height of the tile 
  31.     -- x, y    : the location of the point to clip within the tile 
  32.     -- adjustY : the distance the point should be moved in the y axis (negative) 
  33.     procedure Clip_Downward( clip    : Clip_Type; 
  34.                              size    : Positive; 
  35.                              x, y    : Natural; 
  36.                              adjustY : out Integer ); 
  37.     pragma Precondition( x < size ); 
  38.     pragma Precondition( y < size ); 
  39.     pragma Postcondition( adjustY <= 0 ); 
  40.     pragma Postcondition( adjustY >= -size ); 
  41.  
  42.     -- Clips a point to a tile as though the point is moving in the upward 
  43.     -- direction. The amount which the point should be adjusted downward is 
  44.     -- returned in 'adjustY'. 'size' is the size of the tile in pixels and 
  45.     -- 'x', 'y' is the point's location within the area of the tile. 'x' and 'y' 
  46.     -- must be in the range of 0..size-1. 
  47.     -- 
  48.     -- clip    : the clipping type of the tile 
  49.     -- size    : the width/height of the tile 
  50.     -- x, y    : the location of the point to clip within the tile 
  51.     -- adjustY : the distance the point should be moved in the y axis (positive) 
  52.     procedure Clip_Upward( clip    : Clip_Type; 
  53.                            size    : Positive; 
  54.                            x, y    : Natural; 
  55.                            adjustY : out Integer ); 
  56.     pragma Precondition( x < size ); 
  57.     pragma Precondition( y < size ); 
  58.     pragma Postcondition( adjustY >= 0 ); 
  59.     pragma Postcondition( adjustY <= size ); 
  60.  
  61.     -- Returns the matching Clip_Type value for a string. The string should be 
  62.     -- the exact name of the enumeration value. 'valid' will return False if 
  63.     -- 'str' is not a valid Clip_Type value. 
  64.     procedure To_Clip_Type( str   : String; 
  65.                             clip  : out Clip_Type; 
  66.                             valid : out Boolean ); 
  67.  
  68.     -- The point at which acceleration is considered to be immediate. Any 
  69.     -- accelerations greater than or equal to this constant will cause an entity 
  70.     -- to immediately reach their target velocity with one tick of the physics 
  71.     -- manager. 
  72.     INSTANT_ACCELERATION : constant Float; 
  73.  
  74. private 
  75.  
  76.     INSTANT_ACCELERATION : constant Float := 100000.0; 
  77.  
  78. end Physics;