bool GraphicsClass::AddCube(D3DXVECTOR3 position, D3DXVECTOR3 rotation, float scale) { bool result; ModelClass* m = new ModelClass; m_Models.push_back(m); result = m->Initialize(m_D3D->GetDevice(), "../Haeigan/data/cube.obj", L"../Haeigan/data/white_plastic.dds"); result = AddPhysXCube(position, rotation, scale); return result; }
void GraphicsClass::AddCubeFromEye() { D3DXVECTOR3 position = m_Camera->GetPosition(); D3DXVECTOR3 rotation(0.0f, 0.0f, 0.0f); D3DXVECTOR3 velocity = m_Camera->GetForward(); D3DXVec3Normalize(&velocity, &velocity); velocity *= 100.0f; bool result; ModelClass* m = new ModelClass; m_Models.push_back(m); result = m->Initialize(m_D3D->GetDevice(), "../Haeigan/data/cube.obj", L"../Haeigan/data/white_plastic.dds"); result = AddPhysXCube(position, rotation, 1.0f, velocity); }
bool ThreeDGraphicsClass::addNewModel(string meshFilename, string textureFilename, string bumpmapFilename) { bool result; ModelClass* newModel = new ModelClass(); if(!newModel) { return false; } result = newModel->Initialize(meshFilename, textureFilename, bumpmapFilename, mLightSource); if(!result) { #ifdef _WIN32 MessageBoxA( NULL, "Model Init Failure", "Error", MB_OK ); #endif return false; } mAllModels->push_back(newModel); return true; }