public HumanPose(EndianBinaryReader reader, int[] version) { m_RootX = new xform(reader, version); m_LookAtPosition = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? (object)reader.ReadVector3() : (object)reader.ReadVector4();//5.4 and up m_LookAtWeight = reader.ReadVector4(); int numGoals = reader.ReadInt32(); m_GoalArray = new List <HumanGoal>(numGoals); for (int i = 0; i < numGoals; i++) { m_GoalArray.Add(new HumanGoal(reader, version)); } m_LeftHandPose = new HandPose(reader, version); m_RightHandPose = new HandPose(reader, version); int numDoFs = reader.ReadInt32(); m_DoFArray = reader.ReadSingleArray(numDoFs); if (version[0] > 5 || (version[0] == 5 && version[1] >= 2))//5.2 and up { int numTDof = reader.ReadInt32(); m_TDoFArray = new object[numTDof]; for (int i = 0; i < numTDof; i++) { m_TDoFArray[i] = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? (object)reader.ReadVector3() : (object)reader.ReadVector4();//5.4 and up } } }
public HumanPose(ObjectReader reader) { var version = reader.version; m_RootX = new xform(reader); m_LookAtPosition = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? reader.ReadVector3() : (Vector3)reader.ReadVector4();//5.4 and up m_LookAtWeight = reader.ReadVector4(); int numGoals = reader.ReadInt32(); m_GoalArray = new HumanGoal[numGoals]; for (int i = 0; i < numGoals; i++) { m_GoalArray[i] = new HumanGoal(reader); } m_LeftHandPose = new HandPose(reader); m_RightHandPose = new HandPose(reader); m_DoFArray = reader.ReadSingleArray(); if (version[0] > 5 || (version[0] == 5 && version[1] >= 2))//5.2 and up { int numTDof = reader.ReadInt32(); m_TDoFArray = new Vector3[numTDof]; for (int i = 0; i < numTDof; i++) { m_TDoFArray[i] = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? reader.ReadVector3() : (Vector3)reader.ReadVector4();//5.4 and up } } }
public AvatarConstant(ObjectReader reader) { var version = reader.version; m_AvatarSkeleton = new Skeleton(reader); m_AvatarSkeletonPose = new SkeletonPose(reader); if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { m_DefaultPose = new SkeletonPose(reader); m_SkeletonNameIDArray = reader.ReadUInt32Array(); } m_Human = new Human(reader); m_HumanSkeletonIndexArray = reader.ReadInt32Array(); if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { m_HumanSkeletonReverseIndexArray = reader.ReadInt32Array(); } m_RootMotionBoneIndex = reader.ReadInt32(); m_RootMotionBoneX = new xform(reader); if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { m_RootMotionSkeleton = new Skeleton(reader); m_RootMotionSkeletonPose = new SkeletonPose(reader); m_RootMotionSkeletonIndexArray = reader.ReadInt32Array(); } }
public ClipMuscleConstant(ObjectReader reader) { var version = reader.version; m_DeltaPose = new HumanPose(reader); m_StartX = new xform(reader); if (version[0] > 5 || (version[0] == 5 && version[1] >= 5))//5.5 and up { m_StopX = new xform(reader); } m_LeftFootStartX = new xform(reader); m_RightFootStartX = new xform(reader); if (version[0] < 5)//5.0 down { m_MotionStartX = new xform(reader); m_MotionStopX = new xform(reader); } m_AverageSpeed = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? reader.ReadVector3() : (Vector3)reader.ReadVector4();//5.4 and up m_Clip = new Clip(reader); m_StartTime = reader.ReadSingle(); m_StopTime = reader.ReadSingle(); m_OrientationOffsetY = reader.ReadSingle(); m_Level = reader.ReadSingle(); m_CycleOffset = reader.ReadSingle(); m_AverageAngularSpeed = reader.ReadSingle(); m_IndexArray = reader.ReadInt32Array(); if (version[0] < 4 || (version[0] == 4 && version[1] < 3)) //4.3 down { var m_AdditionalCurveIndexArray = reader.ReadInt32Array(); } int numDeltas = reader.ReadInt32(); m_ValueArrayDelta = new List <ValueDelta>(numDeltas); for (int i = 0; i < numDeltas; i++) { m_ValueArrayDelta.Add(new ValueDelta(reader)); } if (version[0] > 5 || (version[0] == 5 && version[1] >= 3))//5.3 and up { m_ValueArrayReferencePose = reader.ReadSingleArray(); } m_Mirror = reader.ReadBoolean(); m_LoopTime = reader.ReadBoolean(); m_LoopBlend = reader.ReadBoolean(); m_LoopBlendOrientation = reader.ReadBoolean(); m_LoopBlendPositionY = reader.ReadBoolean(); m_LoopBlendPositionXZ = reader.ReadBoolean(); if (version[0] > 5 || (version[0] == 5 && version[1] >= 5))//5.5 and up { m_StartAtOrigin = reader.ReadBoolean(); } m_KeepOriginalOrientation = reader.ReadBoolean(); m_KeepOriginalPositionY = reader.ReadBoolean(); m_KeepOriginalPositionXZ = reader.ReadBoolean(); m_HeightFromFeet = reader.ReadBoolean(); reader.AlignStream(); }
public HandPose(ObjectReader reader) { m_GrabX = new xform(reader); m_DoFArray = reader.ReadSingleArray(); m_Override = reader.ReadSingle(); m_CloseOpen = reader.ReadSingle(); m_InOut = reader.ReadSingle(); m_Grab = reader.ReadSingle(); }
public SkeletonPose(ObjectReader reader) { int numXforms = reader.ReadInt32(); m_X = new xform[numXforms]; for (int i = 0; i < numXforms; i++) { m_X[i] = new xform(reader); } }
public HumanGoal(EndianBinaryReader reader, int[] version) { m_X = new xform(reader, version); m_WeightT = reader.ReadSingle(); m_WeightR = reader.ReadSingle(); if (version[0] >= 5) //5.0 and up { m_HintT = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? (object)reader.ReadVector3() : (object)reader.ReadVector4(); //5.4 and up m_HintWeightT = reader.ReadSingle(); } }
public AvatarConstant(ObjectReader reader) { var version = reader.version; m_AvatarSkeleton = new Skeleton(reader); m_AvatarSkeletonPose = new SkeletonPose(reader); if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { m_DefaultPose = new SkeletonPose(reader); 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(reader); int numIndexes = reader.ReadInt32(); m_HumanSkeletonIndexArray = new List <int>(numIndexes); for (int i = 0; i < numIndexes; i++) { m_HumanSkeletonIndexArray.Add(reader.ReadInt32()); } if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { 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(reader); if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { m_RootMotionSkeleton = new Skeleton(reader); m_RootMotionSkeletonPose = new SkeletonPose(reader); int numMotionIndexes = reader.ReadInt32(); m_RootMotionSkeletonIndexArray = new List <int>(numMotionIndexes); for (int i = 0; i < numMotionIndexes; i++) { m_RootMotionSkeletonIndexArray.Add(reader.ReadInt32()); } } }
public Collider(ObjectReader reader) { m_X = new xform(reader); m_Type = reader.ReadUInt32(); m_XMotionType = reader.ReadUInt32(); m_YMotionType = reader.ReadUInt32(); m_ZMotionType = reader.ReadUInt32(); m_MinLimitX = reader.ReadSingle(); m_MaxLimitX = reader.ReadSingle(); m_MaxLimitY = reader.ReadSingle(); m_MaxLimitZ = reader.ReadSingle(); }
public Collider(EndianBinaryReader reader, int[] version) { m_X = new xform(reader, version); m_Type = reader.ReadUInt32(); m_XMotionType = reader.ReadUInt32(); m_YMotionType = reader.ReadUInt32(); m_ZMotionType = reader.ReadUInt32(); m_MinLimitX = reader.ReadSingle(); m_MaxLimitX = reader.ReadSingle(); m_MaxLimitY = reader.ReadSingle(); m_MaxLimitZ = reader.ReadSingle(); }
public Human(ObjectReader reader) { var version = reader.version; m_RootX = new xform(reader); m_Skeleton = new Skeleton(reader); m_SkeletonPose = new SkeletonPose(reader); m_LeftHand = new Hand(reader); m_RightHand = new Hand(reader); if (version[0] < 2018 || (version[0] == 2018 && version[1] < 2)) //2018.2 down { var numHandles = reader.ReadInt32(); m_Handles = new Handle[numHandles]; for (var i = 0; i < numHandles; i++) { m_Handles[i] = new Handle(reader); } var numColliders = reader.ReadInt32(); m_ColliderArray = new Collider[numColliders]; for (var i = 0; i < numColliders; i++) { m_ColliderArray[i] = new Collider(reader); } } m_HumanBoneIndex = reader.ReadInt32Array(); m_HumanBoneMass = reader.ReadSingleArray(); if (version[0] < 2018 || (version[0] == 2018 && version[1] < 2)) //2018.2 down { m_ColliderIndex = reader.ReadInt32Array(); } 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(); if (version[0] > 5 || (version[0] == 5 && version[1] >= 2)) //5.2 and up { m_HasTDoF = reader.ReadBoolean(); } reader.AlignStream(); }
public HandPose(EndianBinaryReader reader, int[] version) { m_GrabX = new xform(reader, version); int numDoFs = reader.ReadInt32(); m_DoFArray = reader.ReadSingleArray(numDoFs); m_Override = reader.ReadSingle(); m_CloseOpen = reader.ReadSingle(); m_InOut = reader.ReadSingle(); m_Grab = reader.ReadSingle(); }
public HumanGoal(ObjectReader reader) { var version = reader.version; m_X = new xform(reader); m_WeightT = reader.ReadSingle(); m_WeightR = reader.ReadSingle(); if (version[0] >= 5) //5.0 and up { m_HintT = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? (object)reader.ReadVector3() : (object)reader.ReadVector4(); //5.4 and up m_HintWeightT = reader.ReadSingle(); } }
public Human(ObjectReader reader) { var version = reader.version; m_RootX = new xform(reader); m_Skeleton = new Skeleton(reader); m_SkeletonPose = new SkeletonPose(reader); m_LeftHand = new Hand(reader); m_RightHand = new Hand(reader); if (version[0] < 2018 || (version[0] == 2018 && version[1] < 2)) //2018.2 down { int numHandles = reader.ReadInt32(); m_Handles = new List <Handle>(numHandles); for (int i = 0; i < numHandles; i++) { m_Handles.Add(new Handle(reader)); } int numColliders = reader.ReadInt32(); m_ColliderArray = new List <Collider>(numColliders); for (int i = 0; i < numColliders; i++) { m_ColliderArray.Add(new Collider(reader)); } } m_HumanBoneIndex = reader.ReadInt32Array(); m_HumanBoneMass = reader.ReadSingleArray(); if (version[0] < 2018 || (version[0] == 2018 && version[1] < 2)) //2018.2 down { m_ColliderIndex = reader.ReadInt32Array(); } 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(); m_HasTDoF = reader.ReadBoolean(); reader.AlignStream(); }
public Handle(ObjectReader reader) { m_X = new xform(reader); m_ParentHumanIndex = reader.ReadUInt32(); m_ID = reader.ReadUInt32(); }
public Handle(EndianBinaryReader reader, int[] version) { m_X = new xform(reader, version); m_ParentHumanIndex = reader.ReadUInt32(); m_ID = reader.ReadUInt32(); }