本文整理汇总了C#中BlamLib.GetStreamedElement方法的典型用法代码示例。如果您正苦于以下问题:C# BlamLib.GetStreamedElement方法的具体用法?C# BlamLib.GetStreamedElement怎么用?C# BlamLib.GetStreamedElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlamLib
的用法示例。
在下文中一共展示了BlamLib.GetStreamedElement方法的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;
//.........这里部分代码省略.........