当前位置: 首页>>代码示例>>C#>>正文


C# BitPack.UnpackUShort方法代码示例

本文整理汇总了C#中BitPack.UnpackUShort方法的典型用法代码示例。如果您正苦于以下问题:C# BitPack.UnpackUShort方法的具体用法?C# BitPack.UnpackUShort怎么用?C# BitPack.UnpackUShort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BitPack的用法示例。


在下文中一共展示了BitPack.UnpackUShort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadMesh

            public virtual void LoadMesh(string filename)
            {
                byte[] buffer = File.ReadAllBytes(filename);
                BitPack input = new BitPack(buffer, 0);

                _header = TrimAt0(input.UnpackString(24));
                if (!String.Equals(_header, MESH_HEADER))
                    return;

                // Populate base mesh variables
                _hasWeights = (input.UnpackByte() != 0);
                _hasDetailTexCoords = (input.UnpackByte() != 0);
                _position = new Vector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat());
                _rotationAngles = new Vector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat());
                _rotationOrder = input.UnpackByte();
                _scale = new Vector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat());
                _numFaces = (ushort)input.UnpackUShort();

                _faces = new Face[_numFaces];

                for (int i = 0; i < _numFaces; i++)
                    _faces[i].Indices = new short[] { input.UnpackShort(), input.UnpackShort(), input.UnpackShort() };
            }
开发者ID:justincc,项目名称:libopenmetaverse,代码行数:23,代码来源:LindenMesh.cs


注:本文中的BitPack.UnpackUShort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。