SDL::Tutorial::3DWorld::Light - A light source in the 3D world
# An overhead light at a nice room ceiling height my $light = SDL::Tutorial::3DWorld::Light->new( X => 0, Y => 3.5, Z => 0, );
Other than in very simple worlds with intentionally flat colour, most game worlds are lit by light sources.
Lights may sometimes be seen as part of the landscape in the sense they are fixed and generally places to best highlight the game world. They can also sometimes be seen as actors, for example when a light source is used as a weapon special effect.
However, for the purpose of this tutorial we will treat lights as first class entities in their own right.
For the purpose of the tutorial only the position of the lighting can be controlled. All lights will have a fixed colour, intensity, and diffusion.
# A light in the sky at noon my $sun = SDL::Tutorial::3DWorld::Light->new( X => 0, Y => 10000, Z => 0, );
new constructor creates a new light source in the 3D world.
In the initial demonstration, only the position of the light is controllable and the nature of the light source (colour, diffusion etc) is fixed.
X accessor provides the location of the actor in metres on the east to west dimension within the 3D world. The positive direction is east.
Y accessor is location of the actor in metres on the vertical dimension within the 3D world. The positive direction is up.
Z accessor provides the actor of the camera in metres on the north to south dimension within the 3D world. The positive direction is north.
Bugs should be reported via the CPAN bug tracker at
Adam Kennedy <firstname.lastname@example.org>
Copyright 2010 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.