NAME
Games::3D::Brush - describes a "brush" in a csg modeling environment
SYNOPSIS
use Games::3D::Brush qw/BRUSH_CUBE/;
use Games::3D::Level;
my $cube = Games::3D::Brush->new( type => BRUSH_CUBE );
my $level = Games::3D::Level->new();
$level->add($cube);
$level->render();
EXPORTS
Exports nothing on default. Can export the following constants.
BRUSH_CUBE BRUSH_WEDGE BRUSH_CYLINDER BRUSH_PYRAMID
BRSUH_SOLID BRUSH_AIR BRUSH_WATER
BRUSH_MAX_SIDES
DESCRIPTION
This package provides a class for representing a brush in the world. Brushes come in different shapes (cubes, wedges etc) and different kinds (air, solid, water etc).
METHODS
It features all the methods of Games::3D::Area (namely: new(), _init(), x(), y(), z(), width(), height(), length(), pos(), size() and pos()) plus:
- render()
-
$brush->render($camera);
Renders the brush.
- shape()
-
print $brush->shape(); $brush->shape(BRUSH_WEDGE);
Set and return or just return the brush's shape.
- type()
-
print $brush->type(); $brush->type(BRUSH_SOLID);
Set and return or just return the brush's type.
- vertices()
-
my @vertices = $brush->vertices();
Return all the vertices from the brush as unrotated, unscale and untranslated. Can be used to get the basic geometric form of the brush.
- vertices_final()
-
my @vertices = $brush->vertices();
Return all the vertices from the brush as rotated, scaled and translated, e.g at the position of the brush inside the level. This can be used to find brushes which share vertices or edges or sides.
- sides()
-
$brush->sides(4); if ($bruhs->side() != 4) { ... }
Set and return or just return the number of sides the brush has. Cubes and wedges always have 4, but cylinders or pyramids may have between 3 and BRUSH_MAX_SIDES.
- default_texture()
-
$room->default_texture(); $room->default_texture( $texture );
Get/set the default texture as OpenGL texture object. Also possible as parameter to new().
AUTHORS
(c) 2003, Tels <http://bloodgate.com/>
SEE ALSO
Games::3D::Area as well as SDL:App::FPS, SDL::App and SDL.