bug fix
This commit is contained in:
+2
-2
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace LibMMD.Model
|
||||
{
|
||||
public class Joint
|
||||
public class MMDJoint
|
||||
{
|
||||
public Joint()
|
||||
public MMDJoint()
|
||||
{
|
||||
AssociatedRigidBodyIndex = new int[2];
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace LibMMD.Model
|
||||
public Bone[] Bones { get; set; }
|
||||
public Morph[] Morphs { get; set; }
|
||||
public MMDRigidBody[] Rigidbodies { get; set; }
|
||||
public Joint[] Joints { get; set; }
|
||||
public MMDJoint[] Joints { get; set; }
|
||||
|
||||
public void Normalize()
|
||||
{
|
||||
|
||||
@@ -64,10 +64,10 @@ namespace LibMMD.Reader
|
||||
private static void ReadConstraints(BinaryReader reader, RawMMDModel model)
|
||||
{
|
||||
var constraintNum = reader.ReadUInt32();
|
||||
model.Joints = new Model.Joint[constraintNum];
|
||||
model.Joints = new Model.MMDJoint[constraintNum];
|
||||
for (var i = 0; i < constraintNum; ++i)
|
||||
{
|
||||
var constraint = new Model.Joint();
|
||||
var constraint = new Model.MMDJoint();
|
||||
constraint.Name = MMDReaderUtil.ReadStringFixedLength(reader, 20, Tools.JapaneseEncoding);
|
||||
constraint.AssociatedRigidBodyIndex[0] = reader.ReadInt32();
|
||||
constraint.AssociatedRigidBodyIndex[1] = reader.ReadInt32();
|
||||
|
||||
@@ -49,10 +49,10 @@ namespace LibMMD.Reader
|
||||
private static void ReadJoints(BinaryReader reader, RawMMDModel model, PmxConfig pmxConfig)
|
||||
{
|
||||
var constraintNum = reader.ReadInt32();
|
||||
model.Joints = new Model.Joint[constraintNum];
|
||||
model.Joints = new Model.MMDJoint[constraintNum];
|
||||
for (var i = 0; i < constraintNum; ++i)
|
||||
{
|
||||
var joint = new Model.Joint
|
||||
var joint = new Model.MMDJoint
|
||||
{
|
||||
Name = MMDReaderUtil.ReadSizedString(reader, pmxConfig.Encoding),
|
||||
NameEn = MMDReaderUtil.ReadSizedString(reader, pmxConfig.Encoding)
|
||||
|
||||
@@ -350,7 +350,7 @@ namespace LibMMD.Unity3D
|
||||
int jointCount = model.RawMMDModel.Joints.Length;
|
||||
for (int i = 0; i < jointCount; i++)
|
||||
{
|
||||
LibMMD.Model.Joint mmdJoint = model.RawMMDModel.Joints[i];
|
||||
LibMMD.Model.MMDJoint mmdJoint = model.RawMMDModel.Joints[i];
|
||||
int jointFromBoneIndex = model.RawMMDModel.Rigidbodies[mmdJoint.AssociatedRigidBodyIndex[0]].AssociatedBoneIndex;
|
||||
int jointToBoneIndex = model.RawMMDModel.Rigidbodies[mmdJoint.AssociatedRigidBodyIndex[1]].AssociatedBoneIndex;
|
||||
if (bonesCount <= jointFromBoneIndex || bonesCount <= jointToBoneIndex) { continue; }
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5edb55cbe49fa3a469c01786155b6ebc
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using LibMMD.Material;
|
||||
using LibMMD.Model;
|
||||
using LibMMD.Util;
|
||||
using UnityEngine;
|
||||
|
||||
namespace LibMMD.Writer
|
||||
{
|
||||
public class PMXWriter
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 640dfd217ee9f8344a2f6988e9ebcc52
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user