本文整理汇总了C++中Mesh::AttachChild方法的典型用法代码示例。如果您正苦于以下问题:C++ Mesh::AttachChild方法的具体用法?C++ Mesh::AttachChild怎么用?C++ Mesh::AttachChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mesh
的用法示例。
在下文中一共展示了Mesh::AttachChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnUpdate
bool Application::OnUpdate()
{
//System Update
m_pMouse->Update();
m_pKeyboard->Update();
m_pCamera->Update();
m_pGameTime->Update();
//m_fRot += PI * GameTime::GetTimeElapsed();
//m_pScene->SetRotateY(m_fRot);
m_pScene->Update();
if(m_pKeyboard->IsKeyPressed(KEY_1))
{
m_pParent->DetachChild(m_pChild);
}
else if(m_pKeyboard->IsKeyPressed(KEY_2))
{
m_pParent->AttachChild(m_pChild);
}
m_pChild->Update();
DX11Camera::FreeLookCamera(m_pCamera,10.0f);
//m_pCamera->LookAt(D3DXVECTOR3(0,0,0));
//Window Update
return m_pWindow->Tick();
}
示例2: OnCreate
bool Application::OnCreate(const char* a_sCmdLine)
{
Utilities::ConsoleShow(true);
//System
m_pWindow = Window::Create("Ichor Window",1024,768);
m_pRenderer = DX11Renderer::Create(m_pWindow);
m_pGameTime = GameTime::Create();
//Input
m_pKeyboard = Keyboard::Create();
m_pMouse = Mouse::Create();
m_pWindow->AttachMouse(m_pMouse);
//Camera
DX11Frustrum oFustrum;
oFustrum.m_fFieldOfView = ((F32)PI_HALF / 2.0f);
oFustrum.m_fScreenAspect = ((F32)m_pWindow->GetWidth() / (F32)m_pWindow->GetHeight());
oFustrum.m_fNear = 0.01f;
oFustrum.m_fFar = 100.0f;
m_pCamera = DX11Camera::Create(oFustrum);
m_pCamera->SetTranslate(0.0f,0.0f,-10.0f);
struct sData
{
char cInitial;
int iVal;
float fVal;
double dVal;
long long llVal;
char cVal;
};
sData* fDelta = new sData;
//Shaders
m_pShaderProp = ShaderProperty::Create("./Data/Shaders/Base.hlsl");
m_pShaderProp->AddCBuffer("Matrix",fDelta,sizeof(sData),0);
//OBJECTS
//Scene
m_pScene = new Node("Scene");
//Cube
m_pParent = dynamic_cast<Mesh*>(CreateCube());
m_pParent->AttachProperty(m_pShaderProp);
m_pParent->SetTranslate(1,0,0);
m_pChild = dynamic_cast<Mesh*>(m_pParent->Clone());
m_pChild->SetTranslate(-5,0,0);
m_pParent->Update();
m_pChild->Update();
//Parenting
m_pScene->AttachChild(m_pParent);
m_pParent->AttachChild(m_pChild);
m_fRot = 0.0f;
return true;
}