本文整理汇总了C++中TriMesh::SetShine方法的典型用法代码示例。如果您正苦于以下问题:C++ TriMesh::SetShine方法的具体用法?C++ TriMesh::SetShine怎么用?C++ TriMesh::SetShine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TriMesh
的用法示例。
在下文中一共展示了TriMesh::SetShine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
}
if (mTextureCoordMap)
{
if (1 == mNumTexcoordToExport)
{
vFormat->Add(VertexFormat::AU_TEXCOORD, VertexFormat::AT_FLOAT2, 0);
}
else if (2 == mNumTexcoordToExport)
{
vFormat->Add(VertexFormat::AU_TEXCOORD, VertexFormat::AT_FLOAT2, 0);
vFormat->Add(VertexFormat::AU_TEXCOORD, VertexFormat::AT_FLOAT2, 1);
}
}
if (mExportSkin)
{
vFormat->Add(VertexFormat::AU_TEXCOORD, VertexFormat::AT_FLOAT4, 1);
vFormat->Add(VertexFormat::AU_TEXCOORD, VertexFormat::AT_FLOAT4, 2);
}
vFormat->Create();
PX2::VertexBuffer *vBuffer = new0 PX2::VertexBuffer(mVertexMapQuantity,
vFormat->GetStride());
VertexBufferAccessor vBA(vFormat, vBuffer);
for (int i=0; i<mVertexMapQuantity; i++)
{
vBA.Position<Float3>(i) = mVertexMap[i];
if (mNormalMap)
{
vBA.Normal<Float3>(i) = mNormalMap[i];
}
if (mColorMap)
{
vBA.Color<Float4>(0, i) = Float4(mColorMap[i][0], mColorMap[i][1],
mColorMap[i][2], mColorMap[i][3]);
}
else
{
if (mExportColor)
vBA.Color<Float4>(0, i) = Float4::WHITE;
}
if (mAlphaMap)
{
vBA.Color<Float4>(0, i) = Float4(mColorMap[i][0], mColorMap[i][1],
mColorMap[i][2], mAlphaMap[i]);
}
if (mTextureCoordMap)
{
if (mNumTexcoordToExport == 1)
{
vBA.TCoord<Float2>(0, i) = Float2(mTextureCoordMap[i][0], 1.0f-mTextureCoordMap[i][1]);
}
else if (mNumTexcoordToExport == 2)
{
Float2 texCoord0 = Float2(mTextureCoordMap[i][0], 1.0f-mTextureCoordMap[i][1]);
vBA.TCoord<Float2>(0, i) = texCoord0;
if (mTextureCoordMap1)
{
vBA.TCoord<Float2>(1, i) = Float2(mTextureCoordMap1[i][0], 1.0f-mTextureCoordMap1[i][1]);
}
else
{
vBA.TCoord<Float2>(1, i) = texCoord0;
}
}
}
}
// IndexBuffer
IndexBuffer *iBuffer = new0 IndexBuffer(3*mFQuantity, 2);
unsigned short *iData = (unsigned short*)iBuffer->GetData();
for (int i=0; i<(int)3*mFQuantity; i++)
{
iData[i] = (unsigned short)mVFace[i];
}
// 创建Mesh
TriMesh *triMesh = new0 TriMesh(vFormat, vBuffer, iBuffer);
triMesh->UpdateModelSpace(Renderable::GU_MODEL_BOUND_ONLY);
if (mExportTargentBinormal)
{
triMesh->UpdateModelSpace(Renderable::GU_USE_GEOMETRY);
}
MaterialInstance *mi = 0;
mi = mMaterialInstance;
triMesh->SetMaterialInstance(mi);
triMesh->SetShine(mShine);
return triMesh;
}