예제 #1
0
        public void Load(string Path, ClientType clientType)
        {
            this.path       = Path;
            this.clientType = clientType;
            BinaryReader binaryReader = new BinaryReader(File.Open(Path, FileMode.Open));
            short        num          = binaryReader.ReadInt16();

            for (int i = 0; i < (int)num; i++)
            {
                ZSC.Mesh mesh = new ZSC.Mesh();
                mesh.read(ref binaryReader);
                this.listMesh.Add(mesh);
            }
            short num2 = binaryReader.ReadInt16();

            for (int i = 0; i < (int)num2; i++)
            {
                ZSC.Materiel materiel = new ZSC.Materiel();
                materiel.read(ref binaryReader);
                this.listMateriel.Add(materiel);
            }
            short num3 = binaryReader.ReadInt16();

            for (int i = 0; i < (int)num3; i++)
            {
                ZSC.Effect effect = new ZSC.Effect();
                effect.read(ref binaryReader);
                this.listEffect.Add(effect);
            }
            short num4 = binaryReader.ReadInt16();

            for (int i = 0; i < (int)num4; i++)
            {
                ZSC.Object @object = new ZSC.Object();
                @object.read(ref binaryReader);
                this.listObject.Add(@object);
            }
            binaryReader.Close();
        }
예제 #2
0
        public void ApplyZSCData(ZSC.Object objectData, int index)
        {
            objectData.list_mesh[index].world = Matrix.Identity;
            if (objectData.list_mesh[index].rotation_enabled)
            {
                objectData.list_mesh[index].world *= Matrix.CreateFromQuaternion(objectData.list_mesh[index].rotation);
            }
            if (objectData.list_mesh[index].scale_enabled)
            {
                objectData.list_mesh[index].world *= Matrix.CreateScale(objectData.list_mesh[index].scale);
            }
            if (objectData.list_mesh[index].position_enabled)
            {
                Vector3 value = Vector3.Transform(objectData.list_mesh[index].position, ZMS.roseCoordinate);
                value.X *= -1f;
                objectData.list_mesh[index].world *= Matrix.CreateTranslation(value / 100f);
            }
            int parent = (int)objectData.list_mesh[index].parent;

            if (objectData.list_mesh[index].parent_enabled && parent >= 0)
            {
            }
            for (int i = 0; i < this.vertex.Length; i++)
            {
                this.vertex[i].Position = Vector3.Transform(this.vertex[i].Position, objectData.list_mesh[index].world);
            }
            if (objectData.list_mesh[index].bone_index_enabled)
            {
                this.bindBoneIndex = new int?((int)objectData.list_mesh[index].bone_index);
            }
            if (objectData.list_mesh[index].dummy_index_enabled)
            {
                this.bindDummyIndex = new int?((int)objectData.list_mesh[index].dummy_index);
            }
            this.vertexBuffer.SetData <ObjectVertex>(this.vertex);
        }
예제 #3
0
 public void Load(string Path, ClientType clientType)
 {
     this.path = Path;
     this.clientType = clientType;
     BinaryReader binaryReader = new BinaryReader(File.Open(Path, FileMode.Open));
     short num = binaryReader.ReadInt16();
     for (int i = 0; i < (int)num; i++)
     {
         ZSC.Mesh mesh = new ZSC.Mesh();
         mesh.read(ref binaryReader);
         this.listMesh.Add(mesh);
     }
     short num2 = binaryReader.ReadInt16();
     for (int i = 0; i < (int)num2; i++)
     {
         ZSC.Materiel materiel = new ZSC.Materiel();
         materiel.read(ref binaryReader);
         this.listMateriel.Add(materiel);
     }
     short num3 = binaryReader.ReadInt16();
     for (int i = 0; i < (int)num3; i++)
     {
         ZSC.Effect effect = new ZSC.Effect();
         effect.read(ref binaryReader);
         this.listEffect.Add(effect);
     }
     short num4 = binaryReader.ReadInt16();
     for (int i = 0; i < (int)num4; i++)
     {
         ZSC.Object @object = new ZSC.Object();
         @object.read(ref binaryReader);
         this.listObject.Add(@object);
     }
     binaryReader.Close();
 }