Exemple #1
0
            public Vector3 GetPosition(uint index)
            {
                Vector3 newPos = new Vector3();

                for (int i = 0; i < 3; i++)
                {
                    newPos[i] = FSHelpers.ReadFloat(_dataCopy, (int)(_positionDataOffset + (index * Vector3.SizeInBytes) + (i * 4)));
                }

                return(newPos);
            }
Exemple #2
0
            public void Load(byte[] data, uint offset)
            {
                MatrixType       = FSHelpers.Read8(data, (int)offset);
                Unknown0         = FSHelpers.Read8(data, (int)offset + 1);
                PacketCount      = (ushort)FSHelpers.Read16(data, (int)offset + 0x2);
                AttribOffset     = (ushort)FSHelpers.Read16(data, (int)offset + 0x4);
                FirstMatrixIndex = (ushort)FSHelpers.Read16(data, (int)offset + 0x6);
                PacketIndex      = (ushort)FSHelpers.Read16(data, (int)offset + 0x8);

                Unknown        = FSHelpers.ReadFloat(data, (int)offset + 0xC);
                BoundingBoxMin = FSHelpers.ReadVector3(data, (int)offset + 0x10);
                BoundingBoxMax = FSHelpers.ReadVector3(data, (int)offset + 0x1C);
            }
Exemple #3
0
 public void Load(byte[] data, uint offset)
 {
     _unknown1 = (ushort)FSHelpers.Read16(data, (int)offset + 0x0);
     //One byte padding.
     _unknown2 = (byte)FSHelpers.Read16(data, (int)offset + 0x3);
     _scale    = FSHelpers.ReadVector3(data, (int)offset + 0x4);
     _rotation = FSHelpers.ReadHalfRot(data, offset + 0x10);
     //2 bytes padding
     _translation    = FSHelpers.ReadVector3(data, (int)offset + 0x18);
     _unknown3       = FSHelpers.ReadFloat(data, (int)offset + 0x24);
     _boundingBoxMin = FSHelpers.ReadVector3(data, (int)offset + 0x28);
     _boundingBoxMax = FSHelpers.ReadVector3(data, (int)offset + 0x34);
 }
Exemple #4
0
            public Matrix3x4 GetMatrix(ushort index)
            {
                Matrix3x4 matrix = new Matrix3x4();

                for (int row = 0; row < 3; row++)
                {
                    for (int col = 0; col < 4; col++)
                    {
                        float rawFloat = FSHelpers.ReadFloat(_dataCopy, (int)_matrixDataOffset + (index * (3 * 4 * 4)) + ((row * 4 * 4) + (col * 4)));
                        matrix[row, col] = (float)Math.Round(rawFloat, 4);
                    }
                }

                return(matrix);
            }
Exemple #5
0
 public float GetWeight(uint index)
 {
     return(FSHelpers.ReadFloat(_dataCopy, (int)(_weightsOffset + (index * 0x4))));
 }