本文整理汇总了C++中TRefCountPtr::GetNumVertices方法的典型用法代码示例。如果您正苦于以下问题:C++ TRefCountPtr::GetNumVertices方法的具体用法?C++ TRefCountPtr::GetNumVertices怎么用?C++ TRefCountPtr::GetNumVertices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRefCountPtr
的用法示例。
在下文中一共展示了TRefCountPtr::GetNumVertices方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FText
//.........这里部分代码省略.........
&MaxCharts
);
if (FAILED(Result))
{
UE_LOG(LogD3D9MeshUtils, Warning,
TEXT("D3DXUVAtlasPartition() returned %u with MaxDesiredStretch=%.2f, TexCoordIndex=%u."),
Result,
MaxDesiredStretch,
TexCoordIndex
);
OutError = LOCTEXT("GenerateUVs_FailedPartition", "GenerateUVs failed, D3DXUVAtlasPartition failed.");
return false;
}
// Extract the chart adjacency data from the D3DX buffer into an array.
for(uint32 TriangleIndex = 0;TriangleIndex < ChartMesh->GetNumFaces();TriangleIndex++)
{
for(int32 EdgeIndex = 0;EdgeIndex < 3;EdgeIndex++)
{
AtlasAndChartAdjacency.Add(*((uint32*)PartitionResultAdjacencyBuffer->GetBufferPointer()+TriangleIndex*3+EdgeIndex));
}
}
// Extract the triangle chart data from the D3DX buffer into an array.
uint32* FacePartitionBufferPointer = (uint32*)FacePartitionBuffer->GetBufferPointer();
for(uint32 TriangleIndex = 0;TriangleIndex < ChartMesh->GetNumFaces();TriangleIndex++)
{
AtlasAndChartTriangleCharts.Add(*FacePartitionBufferPointer++);
}
// Scale the partitioned UVs down.
FUtilVertex* LockedVertices;
ChartMesh->LockVertexBuffer(0,(LPVOID*)&LockedVertices);
for(uint32 VertexIndex = 0;VertexIndex < ChartMesh->GetNumVertices();VertexIndex++)
{
LockedVertices[VertexIndex].UVs[TexCoordIndex] /= 2048.0f;
}
ChartMesh->UnlockVertexBuffer();
}
if(ChartMesh)
{
// Create a buffer to hold the triangle chart data.
TRefCountPtr<ID3DXBuffer> MergedTriangleChartsBuffer;
VERIFYD3D9RESULT(D3DXCreateBuffer(
AtlasAndChartTriangleCharts.Num() * sizeof(int32),
MergedTriangleChartsBuffer.GetInitReference()
));
uint32* MergedTriangleChartsBufferPointer = (uint32*)MergedTriangleChartsBuffer->GetBufferPointer();
for(int32 TriangleIndex = 0;TriangleIndex < AtlasAndChartTriangleCharts.Num();TriangleIndex++)
{
*MergedTriangleChartsBufferPointer++ = AtlasAndChartTriangleCharts[TriangleIndex];
}
const uint32 FakeTexSize = 1024;
const float GutterSize = ( float )FakeTexSize * MinChartSpacingPercent * 0.01f;
// Pack the charts into a unified atlas.
HRESULT Result = D3DXUVAtlasPack(
ChartMesh,
FakeTexSize,
FakeTexSize,
GutterSize,
TexCoordIndex,
(::DWORD *)AtlasAndChartAdjacency.GetTypedData(),
&GenerateUVsStatusCallback,