本文整理汇总了C++中SimObject::SetVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ SimObject::SetVisible方法的具体用法?C++ SimObject::SetVisible怎么用?C++ SimObject::SetVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimObject
的用法示例。
在下文中一共展示了SimObject::SetVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
//.........这里部分代码省略.........
AddObject(testObj);
// and here goes box
SimObject* testObjBox = new SimObject();
testObjBox->Initialize("testObjBox");
tPos = (glm::vec3(0.0f, 999.0f, 0.0f));
tScl = (glm::vec3(1.0f, 1.0f, 1.0f));
tCol = (glm::vec4(0.4f, 0.7f, 0.9f, 1.0f));
Transform* testObjBoxTransform = new Transform(testObjBox);
testObjBoxTransform->Initialize();
testObjBoxTransform->SetPosition(&tPos);
testObjBoxTransform->SetScale(&tScl);
testObjBox->SetTransform(testObjBoxTransform);
tCol = glm::vec4(0.2f, 0.2f, 0.8f, 1.0f);
MeshGLBox* box = new MeshGLBox(testObjBox, 4.0f, 3.0f, 3.0f, &tCol);
box->Initialize();
box->SetGloss(100.0f);
box->SetSpecular(0.5f);
box->SetTextureID(ResourceManager::GetInstance()->GetTextureWhite());
testObjBox->AddMesh(box);
tPosMin = glm::vec3(-2.0f, -1.5f, -1.5f);
tPosMax = glm::vec3(2.0f, 1.5f, 1.5f);
BoxAACollider* tObjBoxCollider = PhysicsManager::GetInstance()->CreateBoxAACollider(testObjBox, &tPosMin, &tPosMax);
testObjBox->AddCollider(tObjBoxCollider);
AddObject(testObjBox);
testObjBoxTransform->SetPosition(&tPos);
testObjBox->SetVisible(false);
testObjBox->SetEnabled(false);
m_currentObjectID = 1;
/*
SimObject* colObj = new SimObject();
colObj->Initialize("colObj");
tPos = (glm::vec3(3.0f, 2.5f, -8.0f));
tScl = (glm::vec3(1.0f, 1.0f, 1.0f));
tCol = (glm::vec4(0.8f, 0.2f, 0.2f, 1.0f));
tPosMin = (glm::vec3(-0.5f, -0.5f, -0.5f));
tPosMax = (glm::vec3(0.5f, 0.5f, 0.5f));
Transform* colObjTransform = new Transform(colObj);
colObjTransform->Initialize();
colObjTransform->SetPosition(&tPos);
colObjTransform->SetScale(&tScl);
colObj->SetTransform(colObjTransform);
MeshGLBox* colBox = new MeshGLBox(colObj, 1.0f, 1.0f, 1.0f, &tCol);
colBox->Initialize();
colBox->SetGloss(60.0f);
colBox->SetSpecular(1.0f);
colBox->SetTextureID(ResourceManager::GetInstance()->GetTextureWhite());
colObj->AddMesh(colBox);
BoxAACollider* cObjCollider = PhysicsManager::GetInstance()->CreateBoxAACollider(colObj, &tPosMin, &tPosMax);
colObj->AddCollider(cObjCollider);
RotateMe* rm = new RotateMe(colObj);
rm->Initialize();
tRot = glm::vec3(0.0f, 0.003f, 0.0f);
rm->SetRotation(&tRot);