コード例 #1
0
ファイル: Mesh.cpp プロジェクト: nilimsarma/Blokus_FPGA
																																					//
// Updates the mesh by calling the optimizeInPlace method
// of the D3DX object and reloading attribute information
void DirectX::Mesh::update( )
{
	DWORD* adjacencyInfo = new DWORD[m_mesh->GetNumFaces( )*sizeof(DWORD)];
	m_mesh->ConvertPointRepsToAdjacency( NULL, adjacencyInfo );
	m_mesh->OptimizeInplace( D3DXMESHOPT_ATTRSORT | D3DXMESHOPT_COMPACT, adjacencyInfo, NULL, NULL, NULL );
	delete[] adjacencyInfo;

	if( m_attributeTable ) delete[] m_attributeTable;
	m_mesh->GetAttributeTable( NULL, &m_nAttributes );
	m_attributeTable = new D3DXATTRIBUTERANGE[m_nAttributes];
	m_mesh->GetAttributeTable( m_attributeTable, &m_nAttributes );

	calculateBoundingSphere( );
	calculateBoundingBox( );
}
コード例 #2
0
ファイル: Drawable.cpp プロジェクト: assafyariv/PSG
	nvmath::Sphere3f const& Drawable::getBoundingSphere (bool recalc) const
	{
		if (recalc)
			m_boundingSphere = calculateBoundingSphere ();
		return m_boundingSphere;
	}
コード例 #3
0
ファイル: Sphere.cpp プロジェクト: Drakesinger/Cinder
Sphere Sphere::calculateBoundingSphere( const vector<vec3> &points )
{
	return calculateBoundingSphere( points.data(), points.size() );
}