fix push_back
This commit is contained in:
parent
1d263b5887
commit
bdcd7163be
@ -255,7 +255,7 @@ PlanetParams populatePlanet(PlanetParams planet, std::vector<Plant::Plant> plant
|
|||||||
PlanetParams populatePlanetInstancingDemo(PlanetParams planet, std::vector<Plant::Plant> plants)
|
PlanetParams populatePlanetInstancingDemo(PlanetParams planet, std::vector<Plant::Plant> plants)
|
||||||
{
|
{
|
||||||
|
|
||||||
int HOW_MANY_PLANTS = 1000;
|
int HOW_MANY_PLANTS = 100;
|
||||||
int eachSpecie = int(HOW_MANY_PLANTS / plant_specimens.size());
|
int eachSpecie = int(HOW_MANY_PLANTS / plant_specimens.size());
|
||||||
|
|
||||||
for (int i = 0; i < plant_specimens.size(); i++)
|
for (int i = 0; i < plant_specimens.size(); i++)
|
||||||
@ -927,11 +927,11 @@ void init(GLFWwindow* window)
|
|||||||
for (int i = 1; i <= 35; ++i) {
|
for (int i = 1; i <= 35; ++i) {
|
||||||
std::string plant_name = "testPlant" + std::to_string(i);
|
std::string plant_name = "testPlant" + std::to_string(i);
|
||||||
std::string model_name = "./models/roslina" + std::to_string(i)+".obj";
|
std::string model_name = "./models/roslina" + std::to_string(i)+".obj";
|
||||||
double random_value = static_cast<double>(rand()) / RAND_MAX;
|
int random_value_1 = rand() % 101;
|
||||||
std::cout << random_value;
|
int random_value_2 = rand() % 11;
|
||||||
//plant_specimens.push_back(Plant::Plant(1, random_value, 1, 1, plant_name, model_name));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
plant_specimens.push_back(Plant::Plant(random_value_1, random_value_2, random_value_1, random_value_2, plant_name, model_name, plant2_1Material));
|
||||||
|
}
|
||||||
defaultTexture = Core::LoadTexture("textures/1.png");
|
defaultTexture = Core::LoadTexture("textures/1.png");
|
||||||
if (defaultTexture == 0) {
|
if (defaultTexture == 0) {
|
||||||
std::cout << "Failed to load default texture" << std::endl;
|
std::cout << "Failed to load default texture" << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user