本文整理匯總了C#中BlamLib.FindStreamedElement方法的典型用法代碼示例。如果您正苦於以下問題:C# BlamLib.FindStreamedElement方法的具體用法?C# BlamLib.FindStreamedElement怎麽用?C# BlamLib.FindStreamedElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BlamLib
的用法示例。
在下文中一共展示了BlamLib.FindStreamedElement方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ReconstructRawVertex
void ReconstructRawVertex(global_geometry_section_info_struct section_info,
int stream_source, BlamLib.Render.VertexBufferInterface.StreamReader stream_reader)
{
LowLevel.Math.real_quaternion quat = new LowLevel.Math.real_quaternion();
if (stream_source == 0)
{
if (stream_reader.FindStreamedElement(BlamLib.Render.VertexBufferInterface.kTypePosition,
ref quat))
{
Point.Position.X = quat.Vector.I;
Point.Position.Y = quat.Vector.J;
Point.Position.Z = quat.Vector.K;
}
if (stream_reader.FindStreamedElement(BlamLib.Render.VertexBufferInterface.kTypeNodeIndices,
ref quat))
{
Point.NodeIndex[0].Value = ((int)quat.Vector.I) - 1;
Point.NodeIndex[1].Value = ((int)quat.Vector.J) - 1;
Point.NodeIndex[2].Value = ((int)quat.Vector.K) - 1;
Point.NodeIndex[3].Value = ((int)quat.W) - 1;
}
if (stream_reader.FindStreamedElement(BlamLib.Render.VertexBufferInterface.kTypeNodeWeights,
ref quat))
{
Point.NodeWeight[0].Value = quat.Vector.I;
Point.NodeWeight[1].Value = quat.Vector.J;
Point.NodeWeight[2].Value = quat.Vector.K;
Point.NodeWeight[3].Value = quat.W;
}
}
else if (stream_source == 1)
{
if (stream_reader.FindStreamedElement(BlamLib.Render.VertexBufferInterface.kTypeTexCoord,
ref quat))
{
Texcoord.X = quat.Vector.I;
Texcoord.Y = quat.Vector.J;
}
}
else if (stream_source == 2)
{
if (stream_reader.FindStreamedElement(BlamLib.Render.VertexBufferInterface.kTypeNormal,
ref quat))
{
Normal.I = quat.Vector.I;
Normal.J = quat.Vector.J;
Normal.K = quat.Vector.K;
}
if (stream_reader.FindStreamedElement(BlamLib.Render.VertexBufferInterface.kTypeBinormal,
ref quat))
{
Binormal.I = quat.Vector.I;
Binormal.J = quat.Vector.J;
Binormal.K = quat.Vector.K;
}
if (stream_reader.FindStreamedElement(BlamLib.Render.VertexBufferInterface.kTypeTangent,
ref quat))
{
Tangent.I = quat.Vector.I;
Tangent.J = quat.Vector.J;
Tangent.K = quat.Vector.K;
}
}
if (section_info != null && stream_source > 2)
{
int x = 2;
// The following LM vertex sources only have one element, so we can call this here
stream_reader.GetStreamedElement(0, ref quat);
if (section_info.SectionLightingFlags.Test(k_lighting_flags_HasLmTexCoords)
&& stream_source == ++x)
{
PrimaryLightmapTexcoord.X = quat.Vector.I;
PrimaryLightmapTexcoord.Y = quat.Vector.J;
}
else if (section_info.SectionLightingFlags.Test(k_lighting_flags_HasLmIncRad)
&& stream_source == ++x)
{
PrimaryLightmapIncidentDirection.I = quat.Vector.I;
PrimaryLightmapIncidentDirection.J = quat.Vector.J;
PrimaryLightmapIncidentDirection.K = quat.Vector.K;
}
else if (section_info.SectionLightingFlags.Test(k_lighting_flags_HasLmColor)
&& stream_source == ++x)
{
// alpha is quad.W, which LM color doesn't use
PrimaryLightmapColor.R = quat.Vector.I;
PrimaryLightmapColor.G = quat.Vector.J;
PrimaryLightmapColor.B = quat.Vector.K;
}
}
#region Unused vertex elements
// if (stream_reader.FindStreamedElement(BlamLib.Render.VertexBufferInterface.VertexBuffersHalo2.kTypeAnisoBinormal,
// ref quat))
// {
// AnisotropicBinormal.I = quat.Vector.I;
//.........這裏部分代碼省略.........