示例#1
0
        public InterpActor(ME3Package Pcc, int Index)
        {
            pcc     = Pcc;
            MyIndex = Index;
            if (pcc.isExport(Index))
            {
                data = pcc.Exports[Index].Data;
            }
            Props = PropertyReader.getPropList(pcc.Exports[Index]);

            foreach (PropertyReader.Property p in Props)
            {
                switch (pcc.getNameEntry(p.Name))
                {
                    #region
                case "Physics":
                    Physics = p.Value.IntValue;
                    break;

                case "RemoteRole":
                    RemoteRole = p.Value.IntValue;
                    break;

                case "bShadowParented":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bShadowParented = true;
                    }
                    break;

                case "bCollideActors":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bCollideActors = true;
                    }
                    break;

                case "bHidden":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bHidden = true;
                    }
                    break;

                case "bPathColliding":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bPathColliding = true;
                    }
                    break;

                case "bCanStepUpOn":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bCanStepUpOn = true;
                    }
                    break;

                case "bHardAttach":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bHardAttach = true;
                    }
                    break;

                case "bStopOnEncroach":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bStopOnEncroach = true;
                    }
                    break;

                case "bHiddenEdGroup":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bHiddenEdGroup = true;
                    }
                    break;

                case "bNoEncroachCheck":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bNoEncroachCheck = true;
                    }
                    break;

                case "bPawnCanBaseOn":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bPawnCanBaseOn = true;
                    }
                    break;

                case "bLockLocation":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bLockLocation = true;
                    }
                    break;

                case "bCollideComplex":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bCollideComplex = true;
                    }
                    break;

                case "bBlockActors":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bBlockActors = true;
                    }
                    break;

                case "bHiddenEd":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bHiddenEd = true;
                    }
                    break;

                case "bBioSnapToBase":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bBioSnapToBase = true;
                    }
                    break;

                case "bIgnoreBaseRotation":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bIgnoreBaseRotation = true;
                    }
                    break;

                case "Tag":
                    Tag = p.Value.IntValue;
                    break;

                case "Group":
                    Group = p.Value.IntValue;
                    break;

                case "BaseBoneName":
                    BaseBoneName = p.Value.IntValue;
                    break;

                case "UniqueTag":
                    UniqueTag = p.Value.IntValue;
                    break;

                case "StaticMeshComponent":
                    StaticMeshComponent = p.Value.IntValue;
                    if (pcc.isExport(StaticMeshComponent - 1) && pcc.Exports[StaticMeshComponent - 1].ClassName == "StaticMeshComponent")
                    {
                        STMC = new StaticMeshComponent(pcc, StaticMeshComponent - 1);
                    }
                    break;

                case "LightEnvironment":
                    LightEnvironment = p.Value.IntValue;
                    break;

                case "CollisionComponent":
                    CollisionComponent = p.Value.IntValue;
                    break;

                case "Base":
                    Base = p.Value.IntValue;
                    break;

                case "BaseSkelComponent":
                    BaseSkelComponent = p.Value.IntValue;
                    break;

                case "DrawScale":
                    DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                    break;

                case "CreationTime":
                    CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                    break;

                case "TickFrequencyAtEndDistance":
                    TickFrequencyAtEndDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                    break;

                case "NetUpdateFrequency":
                    NetUpdateFrequency = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                    break;

                case "DrawScale3D":
                    DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12),
                                              BitConverter.ToSingle(p.raw, p.raw.Length - 8),
                                              BitConverter.ToSingle(p.raw, p.raw.Length - 4));
                    break;

                case "Rotation":
                    Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12),
                                          BitConverter.ToInt32(p.raw, p.raw.Length - 8),
                                          BitConverter.ToInt32(p.raw, p.raw.Length - 4));
                    break;

                case "location":
                    location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12),
                                           BitConverter.ToSingle(p.raw, p.raw.Length - 8),
                                           BitConverter.ToSingle(p.raw, p.raw.Length - 4));
                    break;
                    #endregion
                }
            }
            MyMatrix  = Matrix.Identity;
            MyMatrix *= Matrix.Scaling(DrawScale3D);
            MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale));
            Vector3 rot = RotatorToDX(Rotator);
            MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z);
            MyMatrix *= Matrix.Translation(location);
        }
示例#2
0
 public InterpActor(ME3Package Pcc, int Index)
 {
     pcc = Pcc;
     MyIndex = Index;
     if (pcc.isExport(Index))
         data = pcc.Exports[Index].Data;
     Props = PropertyReader.getPropList(pcc.Exports[Index]);
     
     foreach (PropertyReader.Property p in Props)
         switch (pcc.getNameEntry(p.Name))
         {
             #region
             case "Physics":
                 Physics = p.Value.IntValue;
                 break;
             case "RemoteRole":
                 RemoteRole = p.Value.IntValue;
                 break;
             case "bShadowParented":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bShadowParented = true;
                 break;
             case "bCollideActors":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bCollideActors = true;
                 break;
             case "bHidden":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bHidden = true;
                 break;
             case "bPathColliding":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bPathColliding = true;
                 break;
             case "bCanStepUpOn":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bCanStepUpOn = true;
                 break;
             case "bHardAttach":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bHardAttach = true;
                 break;
             case "bStopOnEncroach":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bStopOnEncroach = true;
                 break;
             case "bHiddenEdGroup":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bHiddenEdGroup = true;
                 break;
             case "bNoEncroachCheck":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bNoEncroachCheck = true;
                 break;
             case "bPawnCanBaseOn":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bPawnCanBaseOn = true;
                 break;
             case "bLockLocation":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bLockLocation = true;
                 break;
             case "bCollideComplex":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bCollideComplex = true;
                 break;
             case "bBlockActors":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bBlockActors = true;
                 break;
             case "bHiddenEd":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bHiddenEd = true;
                 break;
             case "bBioSnapToBase":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bBioSnapToBase = true;
                 break;
             case "bIgnoreBaseRotation":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bIgnoreBaseRotation = true;
                 break;
             case "Tag":
                 Tag = p.Value.IntValue;
                 break;
             case "Group":
                 Group = p.Value.IntValue;
                 break;
             case "BaseBoneName":
                 BaseBoneName = p.Value.IntValue;
                 break;
             case "UniqueTag":
                 UniqueTag = p.Value.IntValue;
                 break;
             case "StaticMeshComponent":
                 StaticMeshComponent = p.Value.IntValue;
                 if (pcc.isExport(StaticMeshComponent - 1) && pcc.Exports[StaticMeshComponent - 1].ClassName == "StaticMeshComponent")
                     STMC = new StaticMeshComponent(pcc, StaticMeshComponent - 1);
                 break;
             case "LightEnvironment":
                 LightEnvironment = p.Value.IntValue;
                 break;
             case "CollisionComponent":
                 CollisionComponent = p.Value.IntValue;
                 break;
             case "Base":
                 Base = p.Value.IntValue;
                 break;
             case "BaseSkelComponent":
                 BaseSkelComponent = p.Value.IntValue;
                 break;
             case "DrawScale":
                 DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                 break;
             case "CreationTime":
                 CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                 break;
             case "TickFrequencyAtEndDistance":
                 TickFrequencyAtEndDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                 break;
             case "NetUpdateFrequency":
                 NetUpdateFrequency = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                 break;
             case "DrawScale3D":
                 DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12),
                                       BitConverter.ToSingle(p.raw, p.raw.Length - 8),
                                       BitConverter.ToSingle(p.raw, p.raw.Length - 4));
                 break;
             case "Rotation":
                 Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12),
                                       BitConverter.ToInt32(p.raw, p.raw.Length - 8),
                                       BitConverter.ToInt32(p.raw, p.raw.Length - 4));
                 break;
             case "location":
                 location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12),
                                       BitConverter.ToSingle(p.raw, p.raw.Length - 8),
                                       BitConverter.ToSingle(p.raw, p.raw.Length - 4));
                 break;
             #endregion
         }
     MyMatrix = Matrix.Identity;
     MyMatrix *= Matrix.Scaling(DrawScale3D);
     MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale));
     Vector3 rot = RotatorToDX(Rotator);
     MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z);
     MyMatrix *= Matrix.Translation(location);
 }
示例#3
0
        public StaticMeshActor(ME3Package Pcc, int Index)
        {
            pcc     = Pcc;
            MyIndex = Index;
            if (pcc.isExport(Index))
            {
                data = pcc.Exports[Index].Data;
            }
            Props = PropertyReader.getPropList(pcc.Exports[Index]);

            foreach (PropertyReader.Property p in Props)
            {
                string s = pcc.getNameEntry(p.Name);
                switch (s)
                {
                    #region
                case "bCollideActors":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bCollideActors = true;
                    }
                    break;

                case "bCanStepUpOn":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bCanStepUpOn = true;
                    }
                    break;

                case "bPathColliding":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bPathColliding = true;
                    }
                    break;

                case "bLockLocation":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bLockLocation = true;
                    }
                    break;

                case "OverridePhysMat":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        OverridePhysMat = true;
                    }
                    break;

                case "bHidden":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bHidden = true;
                    }
                    break;

                case "bShadowParented":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bShadowParented = true;
                    }
                    break;

                case "bCollideComplex":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bCollideComplex = true;
                    }
                    break;

                case "bHiddenEd":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bHiddenEd = true;
                    }
                    break;

                case "Tag":
                    Tag = p.Value.IntValue;
                    break;

                case "Group":
                    Group = p.Value.IntValue;
                    break;

                case "UniqueTag":
                    UniqueTag = p.Value.IntValue;
                    break;

                case "StaticMeshComponent":
                    StaticMeshComponent = p.Value.IntValue;
                    if (pcc.isExport(StaticMeshComponent - 1) && pcc.Exports[StaticMeshComponent - 1].ClassName == "StaticMeshComponent")
                    {
                        STMC = new StaticMeshComponent(pcc, StaticMeshComponent - 1);
                    }
                    break;

                case "CollisionComponent":
                    CollisionComponent = p.Value.IntValue;
                    break;

                case "DrawScale":
                    DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                    break;

                case "CreationTime":
                    CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                    break;

                case "AudioOcclusion":
                    AudioOcclusion = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                    break;

                    #endregion
                case "DrawScale3D":
                    DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12),
                                              BitConverter.ToSingle(p.raw, p.raw.Length - 8),
                                              BitConverter.ToSingle(p.raw, p.raw.Length - 4));
                    break;

                case "Rotation":
                    Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12),
                                          BitConverter.ToInt32(p.raw, p.raw.Length - 8),
                                          BitConverter.ToInt32(p.raw, p.raw.Length - 4));
                    break;

                case "location":
                    location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12),
                                           BitConverter.ToSingle(p.raw, p.raw.Length - 8),
                                           BitConverter.ToSingle(p.raw, p.raw.Length - 4));
                    break;
                }
            }
            MyMatrix  = Matrix.Identity;
            MyMatrix *= Matrix.Scaling(DrawScale3D);
            MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale));
            Vector3 rot = RotatorToDX(Rotator);
            MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z);
            MyMatrix *= Matrix.Translation(location);
        }
 public StaticMeshActor(PCCObject Pcc, int Index)
 {
     pcc = Pcc;
     MyIndex = Index;
     if (pcc.isExport(Index))
         data = pcc.Exports[Index].Data;
     Props = PropertyReader.getPropList(pcc, data);
     BitConverter.IsLittleEndian = true;
     foreach (PropertyReader.Property p in Props)
     {
         string s =pcc.getNameEntry(p.Name);
         switch (s)
         {
             #region
             case "bCollideActors":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bCollideActors = true;
                 break;
             case "bCanStepUpOn":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bCanStepUpOn = true;
                 break;
             case "bPathColliding":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bPathColliding = true;
                 break;
             case "bLockLocation":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bLockLocation = true;
                 break;
             case "OverridePhysMat":
                 if (p.raw[p.raw.Length - 1] == 1)
                     OverridePhysMat = true;
                 break;
             case "bHidden":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bHidden = true;
                 break;
             case "bShadowParented":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bShadowParented = true;
                 break;
             case "bCollideComplex":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bCollideComplex = true;
                 break;
             case "bHiddenEd":
                 if (p.raw[p.raw.Length - 1] == 1)
                     bHiddenEd = true;
                 break;
             case "Tag":
                 Tag = p.Value.IntValue;
                 break;
             case "Group":
                 Group = p.Value.IntValue;
                 break;
             case "UniqueTag":
                 UniqueTag = p.Value.IntValue;
                 break;
             case "StaticMeshComponent":
                 StaticMeshComponent = p.Value.IntValue;
                 if (pcc.isExport(StaticMeshComponent - 1) && pcc.Exports[StaticMeshComponent - 1].ClassName == "StaticMeshComponent")
                     STMC = new StaticMeshComponent(pcc, StaticMeshComponent - 1);
                 break;
             case "CollisionComponent":
                 CollisionComponent = p.Value.IntValue;
                 break;
             case "DrawScale":
                 DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                 break;
             case "CreationTime":
                 CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                 break;
             case "AudioOcclusion":
                 AudioOcclusion = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                 break;
             #endregion
             case "DrawScale3D":
                 DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12),
                                       BitConverter.ToSingle(p.raw, p.raw.Length - 8),
                                       BitConverter.ToSingle(p.raw, p.raw.Length - 4));
                 break;
             case "Rotation":
                 Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12),
                                       BitConverter.ToInt32(p.raw, p.raw.Length - 8),
                                       BitConverter.ToInt32(p.raw, p.raw.Length - 4));
                 break;
             case "location":
                 location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12),
                                       BitConverter.ToSingle(p.raw, p.raw.Length - 8),
                                       BitConverter.ToSingle(p.raw, p.raw.Length - 4));
                 break;
         }
     }
     MyMatrix = Matrix.Identity;            
     MyMatrix *= Matrix.Scaling(DrawScale3D);
     MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale));
     Vector3 rot = RotatorToDX(Rotator);
     MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z);
     MyMatrix *= Matrix.Translation(location);
 }