本文整理汇总了C++中GMatrix::Inverse方法的典型用法代码示例。如果您正苦于以下问题:C++ GMatrix::Inverse方法的具体用法?C++ GMatrix::Inverse怎么用?C++ GMatrix::Inverse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GMatrix
的用法示例。
在下文中一共展示了GMatrix::Inverse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wFileName
int MaxExporter::DoExport(const TCHAR *name,ExpInterface *ei,Interface *i, BOOL suppressPrompts, DWORD options)
{
/*if(!suppressPrompts)
DialogBoxParam(hInstance,
MAKEINTRESOURCE(IDD_PANEL),
GetActiveWindow(),
MaxExporterOptionsDlgProc, (LPARAM)this);*/
#pragma message(TODO("return TRUE If the file is exported properly"))
Node::s_nextID = 1;
ofstream myFile;
myFile.open("DebugExporter.txt");
wstring wFileName( name );
string fileName( wFileName.begin(), wFileName.end() );
//f= fopen( fileName.c_str(),"wb");
BinaryFile = loadSave( fileName.c_str() );
//BinaryFile.saveInt( 5 );
//BinaryFile.close();
myFile << "Start Export\n";
IGameScene* gameScene = GetIGameInterface();
gameScene->InitialiseIGame();
int nodeCount = gameScene->GetTopLevelNodeCount();
myFile << "Number of top level nodes: " << nodeCount << "\n";
//get all of the materials
for( int nodeNumber = 0; nodeNumber < nodeCount; ++nodeNumber)
{
IGameNode* gameNode = gameScene->GetTopLevelNode( nodeNumber );
Node* myNode = new Node( gameNode );
m_NodeList.push_back( myNode );
findFaces( myNode, myFile );
}
myFile << "Number of materials\n";
myFile << m_materialSet.size() << "\n";
int totalBatches = 0;
//myFile<< "Number of triangleBatchMaps: " << m_triangleBatchesPerNode.size() << "\n";
for( auto nodeIter = m_NodeList.begin(); nodeIter != m_NodeList.end(); ++nodeIter )
{
std::map< IGameMaterial*, TriangleBatch* > triangleBatches = (*nodeIter)->m_triangleBatchesPerMaterial;
myFile << "Invidiual triangleBatch size: " << triangleBatches.size() << "\n";
for( auto materialIter = m_materialSet.begin(); materialIter != m_materialSet.end(); ++materialIter )
{
auto found = triangleBatches.find( * materialIter );
if( found != triangleBatches.end() )
{
++totalBatches;
}
}
}
BinaryFile.saveInt( m_NodeList.size() );
myFile << "Number of Nodes: " << m_NodeList.size() << "\n";
for( auto nodeIter = m_NodeList.begin(); nodeIter != m_NodeList.end(); ++nodeIter )
{
std::map< IGameMaterial*, TriangleBatch* > triangleBatches = (*nodeIter)->m_triangleBatchesPerMaterial;
std::map<IGameMaterial*, std::vector< NodeFace > > facesPerMaterial = (*nodeIter)->m_facesPerMaterial;
IGameNode* currentNode = (*nodeIter)->m_gameNode;
IGameNode* parentNode;
GMatrix parentWTM;
GMatrix toParentMatrix;
GMatrix worldTM;
GMatrix localTM;
int time = gameScene->GetSceneStartTime();
for( ; time < gameScene->GetSceneEndTime(); time += 4800/30 )
{
if( (*nodeIter)->m_parentID != 0 )
{
myFile << "Trying to find parent... \n";
parentNode = (*nodeIter)->m_parent->m_gameNode;
if( parentNode != nullptr )
{
myFile << "Parent found \n";
parentWTM = parentNode->GetWorldTM( time );
toParentMatrix = parentWTM.Inverse();
worldTM = currentNode->GetWorldTM( time ) * toParentMatrix;
}
}
else
{
worldTM = currentNode->GetWorldTM( time );
}
(*nodeIter)->m_toParentMatrix.push_back( Matrix4x4( worldTM[0], worldTM[1], worldTM[2], worldTM[3] ) );
}
localTM = currentNode->GetWorldTM().Inverse();
(*nodeIter)->m_worldToLocal = Matrix4x4( localTM[0], localTM[1], localTM[2], localTM[3] );
//.........这里部分代码省略.........