Index

Package: Managers

Description

package Physics.Managers is
Copyright (c) 2012 Kevin Wellwood All rights reserved. This source code is distributed under the Modified BSD License. For terms and conditions, see license.txt.

Classes

Physics_Manager

type Physics_Manager is new Object and Process and Event_Listener with private;

Ancestors:

Primitive operations:

Construct
Delete (overriding Objects.Delete)
Events.Listeners.To_String (Inherited)
Get_Process_Name (overriding Processes.Get_Process_Name)
Handle_Event (overriding Events.Listeners.Handle_Event)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
Objects.To_String (Inherited)
Tick (overriding Processes.Tick)
The Physics_Manager class is responsible for simulating physical interaction between the entities and between entities and the world. A physics manager listens for world and entity events. It represents the world's tile map with a Clip_Map object contains physical information about the world based on tile attributes: solid walls, slopes, etc. Entities in the world are represented as Corpus objects, modelling only the location, size, and physical attributes of their corresponding entities. The physics manager runs as a Process that updates position, velocity, and acceleration of entities, simulates the effects of gravity and friction, and generates events when entities collide and separate.

Types

A_Physics

type A_Physics is access all Physics_Manager'Class;

Subprograms & Entries

Create_Physics

function Create_Physics
( corral: not null A_Corral ) return A_Physics;
Creates a new physics manager attached to the given Corral.

Friction_X

function Friction_X
( this: not null access Physics_Manager'Class ) return Float;
Sets the friction in the X axis for entities handled by this physics manager.

Friction_Y

function Friction_Y
( this: not null access Physics_Manager'Class ) return Float;
Sets the friction in the Y axis for entities handled by this physics manager.

Gravity

function Gravity
( this: not null access Physics_Manager'Class ) return Float;
Sets the gravitional acceleration for entities handled by this physics manager.

Max_VX

function Max_VX
( this: not null access Physics_Manager'Class ) return Float;
Sets the maximum velocity in the X axis for entities handled by this physics manager.

Max_VY

function Max_VY
( this: not null access Physics_Manager'Class ) return Float;
Sets the maximum velocity in the Y axis for entities handled by this physics manager.

Delete

procedure Delete
( this: in out A_Physics );
Deletes the physics manager and all its data (clip map, corps, etc.)