Example #1
0
        public void Write(BinaryWriter bw, PmxDocument doc)
        {
            bw.WriteSizedBuffer(doc.Header.Encoding.GetBytes(this.Name));
            bw.WriteSizedBuffer(doc.Header.Encoding.GetBytes(this.EnglishName));
            this.Diffuse.ForEach(bw.Write);
            this.Specular.ForEach(bw.Write);
            bw.Write(this.Power);
            this.Ambient.ForEach(bw.Write);
            bw.Write((byte)this.Options);
            this.EdgeColor.ForEach(bw.Write);
            bw.Write(this.EdgeSize);
            doc.WriteIndex(bw, PmxIndexKind.Texture, this.MainTexture);
            doc.WriteIndex(bw, PmxIndexKind.Texture, this.SubTexture);
            bw.Write((byte)this.SubTextureMode);
            bw.Write(this.UseSharedToonTexture);

            if (this.UseSharedToonTexture)
            {
                bw.Write((byte)this.ToonTexture);
            }
            else
            {
                doc.WriteIndex(bw, PmxIndexKind.Texture, this.ToonTexture);
            }

            bw.WriteSizedBuffer(doc.Header.Encoding.GetBytes(this.Comment));
            bw.Write(this.IndexCount);
        }
Example #2
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     base.Write(bw, doc);
     doc.WriteIndex(bw, PmxIndexKind.Rigid, this.RigidA);
     doc.WriteIndex(bw, PmxIndexKind.Rigid, this.RigidB);
     this.Position.ForEach(bw.Write);
     this.Rotation.ForEach(bw.Write);
     this.LinearLowerLimit.ForEach(bw.Write);
     this.LinearUpperLimit.ForEach(bw.Write);
     this.AngularLowerLimit.ForEach(bw.Write);
     this.AngularUpperLimit.ForEach(bw.Write);
     this.LinearSpringStiffness.ForEach(bw.Write);
     this.AngularSpringStiffness.ForEach(bw.Write);
 }
Example #3
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Rigid, this.Rigid);
     bw.Write(this.IsLocal);
     this.CentralImpulse.ForEach(bw.Write);
     this.TorqueImpulse.ForEach(bw.Write);
 }
Example #4
0
        public void Write(BinaryWriter bw, PmxDocument doc)
        {
            doc.WriteString(bw, this.Name);
            doc.WriteString(bw, this.EnglishName);
            this.Position.ForEach(bw.Write);
            doc.WriteIndex(bw, PmxIndexKind.Bone, this.ParentBone);
            bw.Write(this.Priority);
            bw.Write((ushort)this.Capabilities);

            if (this.Capabilities.HasFlag(PmxBoneCapabilities.ConnectToBone))
            {
                doc.WriteIndex(bw, PmxIndexKind.Bone, this.ConnectToBone);
            }
            else
            {
                this.ConnectToOffset.ForEach(bw.Write);
            }

            if (this.Capabilities.HasFlag(PmxBoneCapabilities.RotationAffected) ||
                this.Capabilities.HasFlag(PmxBoneCapabilities.MovementAffected))
            {
                doc.WriteIndex(bw, PmxIndexKind.Bone, this.AffectedBone);
                bw.Write(this.AffectionRate);
            }

            if (this.Capabilities.HasFlag(PmxBoneCapabilities.FixedAxis))
            {
                this.FixedAxis.ForEach(bw.Write);
            }

            if (this.Capabilities.HasFlag(PmxBoneCapabilities.LocalAxis))
            {
                this.LocalVectorX.ForEach(bw.Write);
                this.LocalVectorZ.ForEach(bw.Write);
            }

            if (this.Capabilities.HasFlag(PmxBoneCapabilities.TransformByExternalParent))
            {
                bw.Write(this.ExternalParentKey);
            }

            if (this.Capabilities.HasFlag(PmxBoneCapabilities.IK))
            {
                this.IK.Write(bw, doc);
            }
        }
Example #5
0
 public void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Bone, this.TargetBone);
     bw.Write(this.LoopCount);
     bw.Write(this.AngleLimitUnit);
     bw.Write(this.BindedBones.Count);
     this.BindedBones.ForEach(_ => _.Write(bw, doc));
 }
Example #6
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     this.Bones.ForEach(_ => doc.WriteIndex(bw, PmxIndexKind.Bone, _));
     bw.Write(this.Weight);
     this.Center.ForEach(bw.Write);
     this.RangeZero.ForEach(bw.Write);
     this.RangeOne.ForEach(bw.Write);
 }
Example #7
0
 public void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Bone, this.TargetBone);
     bw.Write(this.LoopCount);
     bw.Write(this.AngleLimitUnit);
     bw.Write(this.BindedBones.Count);
     this.BindedBones.ForEach(_ => _.Write(bw, doc));
 }
Example #8
0
        public void Write(BinaryWriter bw, PmxDocument doc)
        {
            doc.WriteIndex(bw, PmxIndexKind.Bone, this.Bone);
            bw.Write(this.IsAngleLimitEnabled);

            if (this.IsAngleLimitEnabled)
            {
                this.LowerAngleLimit.ForEach(bw.Write);
                this.HigherAngleLimit.ForEach(bw.Write);
            }
        }
Example #9
0
        public void Write(BinaryWriter bw, PmxDocument doc)
        {
            doc.WriteIndex(bw, PmxIndexKind.Bone, this.Bone);
            bw.Write(this.IsAngleLimitEnabled);

            if (this.IsAngleLimitEnabled)
            {
                this.LowerAngleLimit.ForEach(bw.Write);
                this.HigherAngleLimit.ForEach(bw.Write);
            }
        }
Example #10
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Material, this.Material);
     bw.Write((byte)this.Kind);
     this.Diffuse.ForEach(bw.Write);
     this.Specular.ForEach(bw.Write);
     bw.Write(this.Power);
     this.Ambient.ForEach(bw.Write);
     this.EdgeColor.ForEach(bw.Write);
     bw.Write(this.EdgeSize);
     this.Texture.ForEach(bw.Write);
     this.SubTexture.ForEach(bw.Write);
     this.ToonTexture.ForEach(bw.Write);
 }
Example #11
0
 public void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteString(bw, this.Name);
     doc.WriteString(bw, this.EnglishName);
     doc.WriteIndex(bw, PmxIndexKind.Bone, this.RelatedBone);
     bw.Write(this.Group);
     bw.Write((ushort)this.CollidableGroups);
     bw.Write((byte)this.Shape);
     this.Size.ForEach(bw.Write);
     this.Position.ForEach(bw.Write);
     this.Rotation.ForEach(bw.Write);
     bw.Write(this.Mass);
     bw.Write(this.LinearDamping);
     bw.Write(this.AngularDamping);
     bw.Write(this.Restitution);
     bw.Write(this.Friction);
     bw.Write((byte)this.Kind);
 }
Example #12
0
        public void Write(BinaryWriter bw, PmxDocument doc)
        {
            bw.WriteSizedBuffer(doc.Header.Encoding.GetBytes(this.Name));
            bw.WriteSizedBuffer(doc.Header.Encoding.GetBytes(this.EnglishName));
            this.Diffuse.ForEach(bw.Write);
            this.Specular.ForEach(bw.Write);
            bw.Write(this.Power);
            this.Ambient.ForEach(bw.Write);
            bw.Write((byte)this.Options);
            this.EdgeColor.ForEach(bw.Write);
            bw.Write(this.EdgeSize);
            doc.WriteIndex(bw, PmxIndexKind.Texture, this.MainTexture);
            doc.WriteIndex(bw, PmxIndexKind.Texture, this.SubTexture);
            bw.Write((byte)this.SubTextureMode);
            bw.Write(this.UseSharedToonTexture);

            if (this.UseSharedToonTexture)
                bw.Write((byte)this.ToonTexture);
            else
                doc.WriteIndex(bw, PmxIndexKind.Texture, this.ToonTexture);

            bw.WriteSizedBuffer(doc.Header.Encoding.GetBytes(this.Comment));
            bw.Write(this.IndexCount);
        }
Example #13
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Morph, this.Morph);
     bw.Write(this.Weight);
 }
Example #14
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Bone, this.Bone);
 }
Example #15
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Bone, this.Bone);
     this.MovementOffset.ForEach(bw.Write);
     this.RotationOffset.ForEach(bw.Write);
 }
Example #16
0
 public void Write(BinaryWriter bw, PmxDocument doc)
 {
     bw.Write((byte)this.Kind);
     doc.WriteIndex(bw, this.Kind == PmxDisplayItemKind.Bone ? PmxIndexKind.Bone : PmxIndexKind.Morph, this.Index);
 }
Example #17
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Morph, this.Morph);
     bw.Write(this.Weight);
 }
Example #18
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Vertex, this.Vertex);
     this.Offset.ForEach(bw.Write);
 }
Example #19
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     this.Bones.ForEach(_ => doc.WriteIndex(bw, PmxIndexKind.Bone, _));
     bw.Write(this.Weight);
 }
Example #20
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     base.Write(bw, doc);
     doc.WriteIndex(bw, PmxIndexKind.Rigid, this.RigidA);
     doc.WriteIndex(bw, PmxIndexKind.Rigid, this.RigidB);
     this.Position.ForEach(bw.Write);
     this.Rotation.ForEach(bw.Write);
     this.LinearLowerLimit.ForEach(bw.Write);
     this.LinearUpperLimit.ForEach(bw.Write);
     this.AngularLowerLimit.ForEach(bw.Write);
     this.AngularUpperLimit.ForEach(bw.Write);
     this.LinearSpringStiffness.ForEach(bw.Write);
     this.AngularSpringStiffness.ForEach(bw.Write);
 }
Example #21
0
 public void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteString(bw, this.Name);
     doc.WriteString(bw, this.EnglishName);
     doc.WriteIndex(bw, PmxIndexKind.Bone, this.RelatedBone);
     bw.Write(this.Group);
     bw.Write((ushort)this.CollidableGroups);
     bw.Write((byte)this.Shape);
     this.Size.ForEach(bw.Write);
     this.Position.ForEach(bw.Write);
     this.Rotation.ForEach(bw.Write);
     bw.Write(this.Mass);
     bw.Write(this.LinearDamping);
     bw.Write(this.AngularDamping);
     bw.Write(this.Restitution);
     bw.Write(this.Friction);
     bw.Write((byte)this.Kind);
 }
Example #22
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Bone, this.Bone);
 }
Example #23
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Rigid, this.Rigid);
     bw.Write(this.IsLocal);
     this.CentralImpulse.ForEach(bw.Write);
     this.TorqueImpulse.ForEach(bw.Write);
 }
Example #24
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     this.Bones.ForEach(_ => doc.WriteIndex(bw, PmxIndexKind.Bone, _));
     this.Weights.ForEach(bw.Write);
 }
Example #25
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Material, this.Material);
     bw.Write((byte)this.Kind);
     this.Diffuse.ForEach(bw.Write);
     this.Specular.ForEach(bw.Write);
     bw.Write(this.Power);
     this.Ambient.ForEach(bw.Write);
     this.EdgeColor.ForEach(bw.Write);
     bw.Write(this.EdgeSize);
     this.Texture.ForEach(bw.Write);
     this.SubTexture.ForEach(bw.Write);
     this.ToonTexture.ForEach(bw.Write);
 }
Example #26
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Bone, this.Bone);
     this.MovementOffset.ForEach(bw.Write);
     this.RotationOffset.ForEach(bw.Write);
 }
Example #27
0
 public override void Write(BinaryWriter bw, PmxDocument doc)
 {
     doc.WriteIndex(bw, PmxIndexKind.Vertex, this.Vertex);
     this.Offset.ForEach(bw.Write);
 }
Example #28
0
 public void Write(BinaryWriter bw, PmxDocument doc)
 {
     bw.Write((byte)this.Kind);
     doc.WriteIndex(bw, this.Kind == PmxDisplayItemKind.Bone ? PmxIndexKind.Bone : PmxIndexKind.Morph, this.Index);
 }
Example #29
0
        public void Write(BinaryWriter bw, PmxDocument doc)
        {
            doc.WriteString(bw, this.Name);
            doc.WriteString(bw, this.EnglishName);
            this.Position.ForEach(bw.Write);
            doc.WriteIndex(bw, PmxIndexKind.Bone, this.ParentBone);
            bw.Write(this.Priority);
            bw.Write((ushort)this.Capabilities);

            if (this.Capabilities.HasFlag(PmxBoneCapabilities.ConnectToBone))
                doc.WriteIndex(bw, PmxIndexKind.Bone, this.ConnectToBone);
            else
                this.ConnectToOffset.ForEach(bw.Write);

            if (this.Capabilities.HasFlag(PmxBoneCapabilities.RotationAffected) ||
                this.Capabilities.HasFlag(PmxBoneCapabilities.MovementAffected))
            {
                doc.WriteIndex(bw, PmxIndexKind.Bone, this.AffectedBone);
                bw.Write(this.AffectionRate);
            }

            if (this.Capabilities.HasFlag(PmxBoneCapabilities.FixedAxis))
                this.FixedAxis.ForEach(bw.Write);

            if (this.Capabilities.HasFlag(PmxBoneCapabilities.LocalAxis))
            {
                this.LocalVectorX.ForEach(bw.Write);
                this.LocalVectorZ.ForEach(bw.Write);
            }

            if (this.Capabilities.HasFlag(PmxBoneCapabilities.TransformByExternalParent))
                bw.Write(this.ExternalParentKey);

            if (this.Capabilities.HasFlag(PmxBoneCapabilities.IK))
                this.IK.Write(bw, doc);
        }