コード例 #1
0
        public void Initialize(ILibFile res)
        {
            if (Lines != null)
            {
                return;
            }
            VMeshData vms;

            if ((vms = res.FindMesh(MeshCRC)) == null)
            {
                Lines = new Vector3[0];
                FLLog.Error("Vms", "VMeshWire cannot find VMeshData CRC 0x" + MeshCRC.ToString("X"));
                return;
            }
            Lines = new Vector3[NumIndices];
            for (int i = 0; i < NumIndices; i++)
            {
                var idx = Indices[i] + VertexOffset;
                //TODO: This is ridiculous
                if (vms.verticesVertexPosition != null)
                {
                    Lines[i] = vms.verticesVertexPosition[idx].Position;
                }
                if (vms.verticesVertexPositionNormal != null)
                {
                    Lines[i] = vms.verticesVertexPositionNormal[idx].Position;
                }
                if (vms.verticesVertexPositionTexture != null)
                {
                    Lines[i] = vms.verticesVertexPositionTexture[idx].Position;
                }
                if (vms.verticesVertexPositionNormalTexture != null)
                {
                    Lines[i] = vms.verticesVertexPositionNormalTexture[idx].Position;
                }
                if (vms.verticesVertexPositionNormalTextureTwo != null)
                {
                    Lines[i] = vms.verticesVertexPositionNormalTextureTwo[idx].Position;
                }
                if (vms.verticesVertexPositionNormalDiffuseTexture != null)
                {
                    Lines[i] = vms.verticesVertexPositionNormalDiffuseTexture[idx].Position;
                }
                if (vms.verticesVertexPositionNormalDiffuseTextureTwo != null)
                {
                    Lines[i] = vms.verticesVertexPositionNormalDiffuseTextureTwo[idx].Position;
                }
            }
        }
コード例 #2
0
 public VMeshData FindMesh(uint vMeshLibId)
 {
     if (VMeshLibrary != null)
     {
         VMeshData mesh = VMeshLibrary.FindMesh(vMeshLibId);
         if (mesh != null)
         {
             return(mesh);
         }
     }
     if (additionalLibrary != null)
     {
         return(additionalLibrary.FindMesh(vMeshLibId));
     }
     return(null);
 }