package Physics is
pragma Pure;
type Clip_Type is (
Passive,
OneWay,
Wall,
Slope_45_Up_Floor, Slope_45_Up_Ceiling,
Slope_45_Down_Floor, Slope_45_Down_Ceiling,
Slope_22_Up_Floor_Thin, Slope_22_Up_Floor_Wide,
Slope_22_Up_Ceiling_Wide, Slope_22_Up_Ceiling_Thin,
Slope_22_Down_Floor_Wide, Slope_22_Down_Floor_Thin,
Slope_22_Down_Ceiling_Thin, Slope_22_Down_Ceiling_Wide
);
-- Combines two Clip_Type values and returns the most occlusive one.
function "or"( l, r : Clip_Type ) return Clip_Type;
-- Clips a point to a tile as though the point is moving in the downward
-- direction. The amount which the point should be adjusted upward is
-- returned in 'adjustY'. 'size' is the size of the tile in pixels and
-- 'x', 'y' is the point's location within the area of the tile. 'x' and 'y'
-- must be in the range of 0..size-1.
--
-- clip : the clipping type of the tile
-- size : the width/height of the tile
-- x, y : the location of the point to clip within the tile
-- adjustY : the distance the point should be moved in the y axis (negative)
procedure Clip_Downward( clip : Clip_Type;
size : Positive;
x, y : Natural;
adjustY : out Integer );
pragma Precondition( x < size );
pragma Precondition( y < size );
pragma Postcondition( adjustY <= 0 );
pragma Postcondition( adjustY >= -size );
-- Clips a point to a tile as though the point is moving in the upward
-- direction. The amount which the point should be adjusted downward is
-- returned in 'adjustY'. 'size' is the size of the tile in pixels and
-- 'x', 'y' is the point's location within the area of the tile. 'x' and 'y'
-- must be in the range of 0..size-1.
--
-- clip : the clipping type of the tile
-- size : the width/height of the tile
-- x, y : the location of the point to clip within the tile
-- adjustY : the distance the point should be moved in the y axis (positive)
procedure Clip_Upward( clip : Clip_Type;
size : Positive;
x, y : Natural;
adjustY : out Integer );
pragma Precondition( x < size );
pragma Precondition( y < size );
pragma Postcondition( adjustY >= 0 );
pragma Postcondition( adjustY <= size );
-- Returns the matching Clip_Type value for a string. The string should be
-- the exact name of the enumeration value. 'valid' will return False if
-- 'str' is not a valid Clip_Type value.
procedure To_Clip_Type( str : String;
clip : out Clip_Type;
valid : out Boolean );
-- The point at which acceleration is considered to be immediate. Any
-- accelerations greater than or equal to this constant will cause an entity
-- to immediately reach their target velocity with one tick of the physics
-- manager.
INSTANT_ACCELERATION : constant Float;
private
INSTANT_ACCELERATION : constant Float := 100000.0;
end Physics;