Defaults::Defaults() :myScaling( makeScaling() ) ,myHasScaling( false ) ,myLayoutGroup( makeLayoutGroup() ) ,myAppearance( makeAppearance() ) ,myHasAppearance( false ) ,myMusicFont( makeMusicFont() ) ,myHasMusicFont( false ) ,myWordFont( makeWordFont() ) ,myHasWordFont( false ) ,myLyricFontSet() ,myLyricLanguageSet() {}
void addTransformedCubes( std::shared_ptr<Container> container ) { // Offset cubes for testing AO float cube_size = 0.2; auto cube1 = std::make_shared<AxisAlignedSlab>( 0.0, 0.0, 0.0, cube_size ); auto cube2 = std::make_shared<AxisAlignedSlab>( 0.0, 0.0, 0.0, cube_size ); auto cube3 = std::make_shared<AxisAlignedSlab>( 0.0, 0.0, 0.0, cube_size ); cube1->material = std::make_shared<DiffuseMaterial>( 1.0, 0.0, 0.0 ); cube2->material = std::make_shared<DiffuseMaterial>( 0.0, 0.0, 1.0 ); cube3->material = std::make_shared<DiffuseMaterial>( 0.0, 1.0, 0.0 ); cube1->transform = std::make_shared<Transform>(); *cube1->transform = makeTranslation( Vector4( 0.1, 0.5, -1.0 ) ); cube2->transform = std::make_shared<Transform>(); *cube2->transform = compose( makeTranslation( Vector4( 0.0, 0.15, -1.0 ) ), compose( makeRotation( M_PI / 4.0, Vector4( 0.0, 1.0, 0.0 ) ), makeRotation( M_PI / 4.0, Vector4( 0.0, 0.0, 1.0 ) ) ) ); cube3->transform = std::make_shared<Transform>(); *cube3->transform = compose( makeTranslation( Vector4( -0.3, 0.0, -1.0 ) ), makeScaling( 0.2, 3.0, 2.0 ) ); container->add( cube1 ); container->add( cube2 ); container->add( cube3 ); addSphereLight( container, Vector4( 3.0, 3.0, -1.0 ), 0.5, RGBColor( 1.0, 1.0, 1.0 ), 200.0 ); addGroundPlane( container ); }