Example #1
0
        public TexCoordGen(EndianBinaryReader reader)
        {
            Type            = (TexGenType)reader.ReadByte();
            Source          = (TexGenSrc)reader.ReadByte();
            TexMatrixSource = (Enums.TexMatrix)reader.ReadByte();

            reader.SkipByte();
        }
Example #2
0
        public TexMatrix(TexGenType projection, byte type, Vector3 effectTranslation, Vector2 scale, float rotation, Vector2 translation, Matrix4 matrix)
        {
            Projection        = projection;
            Type              = type;
            EffectTranslation = effectTranslation;

            Scale       = scale;
            Rotation    = rotation;
            Translation = translation;

            ProjectionMatrix = matrix;
        }
Example #3
0
        public void AddTexMatrix(TexGenType projection, byte type, Vector3 effectTranslation, Vector2 scale, float rotation, Vector2 translation, Matrix4 matrix)
        {
            for (int i = 0; i < 10; i++)
            {
                if (TexMatrix1[i] == null)
                {
                    TexMatrix1[i] = new TexMatrix(projection, type, effectTranslation, scale, rotation, translation, matrix);
                    break;
                }

                if (i == 9)
                {
                    throw new Exception($"TexMatrix1 array for material \"{ Name }\" is full!");
                }
            }
        }
Example #4
0
        public TexMatrix(EndianBinaryReader reader)
        {
            Projection = (TexGenType)reader.ReadByte();
            Type       = reader.ReadByte();
            reader.SkipInt16();
            EffectTranslation = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
            Scale             = new Vector2(reader.ReadSingle(), reader.ReadSingle());
            Rotation          = reader.ReadInt16() * (180 / 32768f);
            reader.SkipInt16();
            Translation = new Vector2(reader.ReadSingle(), reader.ReadSingle());

            ProjectionMatrix = new Matrix4(
                reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(),
                reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(),
                reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(),
                reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
        }
Example #5
0
        public void AddTexGen(TexGenType genType, TexGenSrc genSrc, Enums.TexMatrix mtrx)
        {
            TexCoordGen newGen = new TexCoordGen(genType, genSrc, mtrx);

            for (int i = 0; i < 8; i++)
            {
                if (TexCoord1Gens[i] == null)
                {
                    TexCoord1Gens[i] = newGen;
                    break;
                }

                if (i == 7)
                {
                    throw new Exception($"TexGen array for material \"{ Name }\" is full!");
                }
            }

            NumTexGensCount++;
        }
Example #6
0
 public TexCoordGen(TexGenType type, TexGenSrc src, Enums.TexMatrix mtrx)
 {
     Type            = type;
     Source          = src;
     TexMatrixSource = mtrx;
 }