本文整理汇总了C++中Renderable::Initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ Renderable::Initialize方法的具体用法?C++ Renderable::Initialize怎么用?C++ Renderable::Initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Renderable
的用法示例。
在下文中一共展示了Renderable::Initialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadTee
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: ReadCup
// 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);
}