Only calculate the true range of every nth laser sample. The missing samples are filled in with a linear interpolation. Generally it would be better to use fewer samples, but some (poorly implemented!) programs expect a fixed number of samples. Setting this number > 1 allows you to reduce the amount of computation required for your fixed-size laser vector.

*/

-// create static vis objects

-

-ModelLaser::Vis::Vis( World* world )

- : Visualizer( "Laser", "laser_vis" )

-{

- world->RegisterOption( &showArea );

- world->RegisterOption( &showStrikes );

- world->RegisterOption( &showFov );

- world->RegisterOption( &showBeams );

-}

-

-voidModelLaser::Vis::Visualize( Model* mod, Camera* cam )

-{

- ModelLaser* laser( dynamic_cast<ModelLaser*>(mod) );

-

- const std::vector<Sample>& samples( laser->GetSamples() );

-

- size_tsample_count( samples.size() );

-

- glPushMatrix();

- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );

-

- glTranslatef( 0,0, laser->GetGeom().size.z/2.0 ); // shoot the laser beam out at the right height