Пример #1
0
void Level::ReadTee(char* tee)
{
  std::stringstream ss(tee);
  
  glm::vec3 pos;
  unsigned int tileid;

  ss >> tileid >> pos.x >> pos.y >> pos.z;

  _tee = new Tee;
  _tee->Initialize();
  _tee->SetTile(tileid - 1);

  // Load Renderable for circle
  // Scale appropriately
  // Position according to the stringstream
  Renderable *r = new Renderable;
  r->Initialize();
  Renderable::Color(glm::vec4(0.f, 0.f, 1.f, 1.f));
  r->LoadFromFile("Models/circle.obj");
  r->PostLoad();
  _tee->SetRenderable(r);
  
  _tee->GetMatrix()->Position(pos + glm::vec3(0.f, .01f, 0.f));
  _tee->GetMatrix()->Scale(0.075f);
}
Пример #2
0
// Same as the Tee, except the Cup is marked as the goal
void Level::ReadCup(char* cup)
{
  std::stringstream ss(cup);

  glm::vec3 pos;
  unsigned int tileid;

  ss >> tileid >> pos.x >> pos.y >> pos.z;
  _cup = new Tee;
  _cup->Initialize();
  _cup->SetTile(tileid - 1);

  Renderable *r = new Renderable;
  r->Initialize();
  Renderable::Color(glm::vec4(1.f, 0.f, 1.f, 1.f));
  r->LoadFromFile("Models/circle.obj");
  r->PostLoad();
  _cup->SetRenderable(r);

  _cup->GetMatrix()->Position(pos + glm::vec3(0.f, .01f, 0.f));
  _cup->GetMatrix()->Scale(0.075f);
  _cup->SetGoal(true);
}