NAME
Games::3D::Level - a class containing one level (loaded from a file)
SYNOPSIS
use Games::3D::Level;
my $level = Games::3D::Level->new( file => 'filename' );
$level->render();
EXPORTS
Exports nothing on default.
DESCRIPTION
This package provides a base class for shapes/areas in 3D space.
METHODS
It features all the methods of Games::3D::Point (namely: new(), _init(), x(), y(), z() and pos()) plus:
- width()
-
print $area->width(); $area->width(123);
Set and return or just return the area's width (size along the X axis).
- length()
-
print $area->length(); $area->length(123);
Set and return or just return the area's length (size along the Y axis).
- height()
-
print $area->height(); $area->height(123);
Set and return or just return the area's height (size along the Z axis).
- brushes()
-
print $level->brushes();
Return the number of brushes inside the level.
- rooms()
-
print $level->rooms();
Return the number of rooms inside the level.
- render()
-
$level->render();
Renders the level by rendering all the portals.
- _load()
-
$level->load($file);
Load a level from a file. Called automatically by new().
- _build_portals()
-
$level->_build_portals();
After _load(), the portals are build to prepare the level for rendering.
- size()
-
print join (" ", $area->size()); $area->size(123,456,-1); # set X,Y and Z $area->size(undef,undef,1); # set only Z
Set and return or just return the area's size along the three axes.
AUTHORS
(c) 2003, Tels <http://bloodgate.com/>
SEE ALSO
Games::3D::Area as well as SDL:App::FPS, SDL::App and SDL.