public DefaultVertexDeclaration(short4 position,byte4 bones,byte4 boneweights,byte4 normals,byte4 tangents,short2 texcoord0,short2 texcoord1) { this.position = position; this.bones = bones; this.boneweights = boneweights; this.normals = normals; this.tangents = tangents; this.texcoord0 = texcoord0; this.texcoord1 = texcoord1; }
//Handlers public static DefaultVertexDeclaration FromByteCode(byte[] data) { short4 position = new short4(BitConverter.ToInt16(data,0), BitConverter.ToInt16(data,2), BitConverter.ToInt16(data,4), BitConverter.ToInt16(data,6) ); byte4 bones = new byte4(data[8], data[9], data[10], data[11]); byte4 boneweights = new byte4(data[12], data[13], data[14], data[15]); byte4 normals = new byte4(data[16], data[17], data[18], data[19]); byte4 tangents = new byte4(data[20], data[21], data[22], data[23]); short2 texcoord0 = new short2(BitConverter.ToInt16(data, 24), BitConverter.ToInt16(data, 26)); short2 texcoord1 = new short2(BitConverter.ToInt16(data, 28), BitConverter.ToInt16(data, 30)); DefaultVertexDeclaration vertexDeclaration = new DefaultVertexDeclaration(position,bones,boneweights,normals,tangents,texcoord0,texcoord1); return vertexDeclaration; }