public Human(Stream stream) { BinaryReader reader = new BinaryReader(stream); m_RootX = new xform(stream); m_Skeleton = new Skeleton(stream); m_SkeletonPose = new SkeletonPose(stream); m_LeftHand = new Hand(stream); m_RightHand = new Hand(stream); int numHandles = reader.ReadInt32(); m_Handles = new List<Handle>(numHandles); for (int i = 0; i < numHandles; i++) { m_Handles.Add(new Handle(stream)); } int numColliders = reader.ReadInt32(); m_ColliderArray = new List<Collider>(numColliders); for (int i = 0; i < numColliders; i++) { m_ColliderArray.Add(new Collider(stream)); } int numIndexes = reader.ReadInt32(); m_HumanBoneIndex = new List<int>(numIndexes); for (int i = 0; i < numIndexes; i++) { m_HumanBoneIndex.Add(reader.ReadInt32()); } int numMasses = reader.ReadInt32(); m_HumanBoneMass = new List<float>(numMasses); for (int i = 0; i < numMasses; i++) { m_HumanBoneMass.Add(reader.ReadSingle()); } int numColliderIndexes = reader.ReadInt32(); m_ColliderIndex = new List<int>(numColliderIndexes); for (int i = 0; i < numColliderIndexes; i++) { m_ColliderIndex.Add(reader.ReadInt32()); } m_Scale = reader.ReadSingle(); m_ArmTwist = reader.ReadSingle(); m_ForeArmTwist = reader.ReadSingle(); m_UpperLegTwist = reader.ReadSingle(); m_LegTwist = reader.ReadSingle(); m_ArmStretch = reader.ReadSingle(); m_LegStretch = reader.ReadSingle(); m_FeetSpacing = reader.ReadSingle(); m_HasLeftHand = reader.ReadBoolean(); m_HasRightHand = reader.ReadBoolean(); reader.ReadBytes(2); }
public AvatarConstant(Stream stream) { BinaryReader reader = new BinaryReader(stream); m_AvatarSkeleton = new Skeleton(stream); m_AvatarSkeletonPose = new SkeletonPose(stream); m_DefaultPose = new SkeletonPose(stream); int numIDs = reader.ReadInt32(); m_SkeletonNameIDArray = new List<uint>(numIDs); for (int i = 0; i < numIDs; i++) { m_SkeletonNameIDArray.Add(reader.ReadUInt32()); } m_Human = new Human(stream); int numIndexes = reader.ReadInt32(); m_HumanSkeletonIndexArray = new List<int>(numIndexes); for (int i = 0; i < numIndexes; i++) { m_HumanSkeletonIndexArray.Add(reader.ReadInt32()); } int numReverseIndexes = reader.ReadInt32(); m_HumanSkeletonReverseIndexArray = new List<int>(numReverseIndexes); for (int i = 0; i < numReverseIndexes; i++) { m_HumanSkeletonReverseIndexArray.Add(reader.ReadInt32()); } m_RootMotionBoneIndex = reader.ReadInt32(); m_RootMotionBoneX = new xform(stream); m_RootMotionSkeleton = new Skeleton(stream); m_RootMotionSkeletonPose = new SkeletonPose(stream); int numMotionIndexes = reader.ReadInt32(); m_RootMotionSkeletonIndexArray = new List<int>(numMotionIndexes); for (int i = 0; i < numMotionIndexes; i++) { m_RootMotionSkeletonIndexArray.Add(reader.ReadInt32()); } }