NAME

Games::3D::PhysEng - a physical engine simulating masses and forces

SYNOPSIS

use Games::3D::PhysEng;

my $mass = Games::3D::Mass->new( mass => 123 );
my $force = Games::3D::Vector->new(0, -9.81, 0);  # gravity pulls down
my $engine = Games::3D::PhysEng->new( min_dt => 100, );

$engine->add_mass($mass);
$engine->add_global_force($force);

# in each frame	
$engine->update($current_time);

EXPORTS

Exports nothing on default.

DESCRIPTION

This package provides a base class for simulating masses and forces in 3D space.

METHODS

update
$engine->update($current_time);

Update the positions and velocities of the objects to reflect the stand at the current time.

add_mass
$engine->add_mass( $mass );

Add one Games::3D::Mass object to the simulation.

add_global_force
$engine->add_global_force( $force );

Add one force (as a Games::3D::Vector object), that will act on all objects in the simulation.

add_attractor
$engine->add_attractor( $attractor );

Add one force (as a Games::3D::Attractor object), that will act on some objects in the simulation.

AUTHORS

(c) 2003, Tels <http://bloodgate.com/>

SEE ALSO

Games::3D::Vector, Games::3D::Mass, Games::3D::Area as well as SDL:App::FPS, SDL::App and SDL.