Commit dfb87d50 authored by chili's avatar chili
Browse files

disable assorted scene genny

parent eaec9510
......@@ -11,53 +11,53 @@ App::App()
:
wnd( 800,600,"The Donkey Fart Box" )
{
class Factory
{
public:
Factory( Graphics& gfx )
:
gfx( gfx )
{}
std::unique_ptr<Drawable> operator()()
{
switch( typedist( rng ) )
{
case 0:
return std::make_unique<Pyramid>(
gfx,rng,adist,ddist,
odist,rdist
);
case 1:
return std::make_unique<Box>(
gfx,rng,adist,ddist,
odist,rdist,bdist
);
case 2:
return std::make_unique<Melon>(
gfx,rng,adist,ddist,
odist,rdist,longdist,latdist
);
default:
assert( false && "bad drawable type in factory" );
return {};
}
}
private:
Graphics& gfx;
std::mt19937 rng{ std::random_device{}() };
std::uniform_real_distribution<float> adist{ 0.0f,PI * 2.0f };
std::uniform_real_distribution<float> ddist{ 0.0f,PI * 0.5f };
std::uniform_real_distribution<float> odist{ 0.0f,PI * 0.08f };
std::uniform_real_distribution<float> rdist{ 6.0f,20.0f };
std::uniform_real_distribution<float> bdist{ 0.4f,3.0f };
std::uniform_int_distribution<int> latdist{ 5,20 };
std::uniform_int_distribution<int> longdist{ 10,40 };
std::uniform_int_distribution<int> typedist{ 0,2 };
};
//class Factory
//{
//public:
// Factory( Graphics& gfx )
// :
// gfx( gfx )
// {}
// std::unique_ptr<Drawable> operator()()
// {
// switch( typedist( rng ) )
// {
// case 0:
// return std::make_unique<Pyramid>(
// gfx,rng,adist,ddist,
// odist,rdist
// );
// case 1:
// return std::make_unique<Box>(
// gfx,rng,adist,ddist,
// odist,rdist,bdist
// );
// case 2:
// return std::make_unique<Melon>(
// gfx,rng,adist,ddist,
// odist,rdist,longdist,latdist
// );
// default:
// assert( false && "bad drawable type in factory" );
// return {};
// }
// }
//private:
// Graphics& gfx;
// std::mt19937 rng{ std::random_device{}() };
// std::uniform_real_distribution<float> adist{ 0.0f,PI * 2.0f };
// std::uniform_real_distribution<float> ddist{ 0.0f,PI * 0.5f };
// std::uniform_real_distribution<float> odist{ 0.0f,PI * 0.08f };
// std::uniform_real_distribution<float> rdist{ 6.0f,20.0f };
// std::uniform_real_distribution<float> bdist{ 0.4f,3.0f };
// std::uniform_int_distribution<int> latdist{ 5,20 };
// std::uniform_int_distribution<int> longdist{ 10,40 };
// std::uniform_int_distribution<int> typedist{ 0,2 };
//};
Factory f( wnd.Gfx() );
drawables.reserve( nDrawables );
std::generate_n( std::back_inserter( drawables ),nDrawables,f );
//Factory f( wnd.Gfx() );
//drawables.reserve( nDrawables );
//std::generate_n( std::back_inserter( drawables ),nDrawables,f );
wnd.Gfx().SetProjection( DirectX::XMMatrixPerspectiveLH( 1.0f,3.0f / 4.0f,0.5f,40.0f ) );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment