コード例 #1
0
ファイル: LightMap.hpp プロジェクト: DeMoully/SFML_Extensions
		void removeLightSource(std::size_t & index)
		{
			if (index < lightCount())
			{
				lights.erase(lights.begin() + index);
			}
		}
コード例 #2
0
ファイル: Scene.cpp プロジェクト: mshafae/CS566SampleCode
void Scene::write( std::ostream &out ) const {
  out << "Input scene file: " << _inputSceneFile << std::endl;
  out << *_camera << std::endl;
  out << _viewPlane << std::endl;
  out << "Number of Lights: " << lightCount( ) << std::endl;
  out << "Lights:" << std::endl;
  for(unsigned int i = 0; i < lightCount( ); i++ ){
    out << _lights[i];
  }
  out << "Background Color: ";
  _backgroundColor.write_row(out) << std::endl;
  out << "Number of Materials: " << materialCount( ) << std::endl;
  out << "Materials:" << std::endl;
  for(unsigned int i = 0; i < materialCount( ); i++){
    out << _materials[i];
  }
  out << "Group:" << std::endl;
  for(unsigned int i = 0; i < objectCount( ); i++){
    _objects[i]->write(out);
  }
}
コード例 #3
0
ファイル: Scene.cpp プロジェクト: mshafae/CS566SampleCode
Light* Scene::lightAtIndex(size_t i){
  if( i >= lightCount( ) ){
    throw std::range_error("Light index out of range");
  }
  return _lights[i];
}