コード例 #1
0
        public CompressedMesh(IAssetsFile assetsFile)
        {
            if (assetsFile == null)
            {
                throw new ArgumentNullException(nameof(assetsFile));
            }
            m_assetsFile = assetsFile;

            if (IsReadMeshData)
            {
                Vertices = new PackedFloatVector();
                UV       = new PackedFloatVector();
                if (IsReadBindPoses)
                {
                    BindPoses = new PackedFloatVector();
                }
                Normals      = new PackedFloatVector();
                Tangents     = new PackedFloatVector();
                Weight       = new PackedIntVector();
                NormalSigns  = new PackedIntVector();
                TangentSigns = new PackedIntVector();
                if (IsReadFloatColors)
                {
                    FloatColors = new PackedFloatVector();
                }
                BoneIndices = new PackedIntVector();
                Triangles   = new PackedIntVector();
            }

            if (IsReadPlainColors)
            {
                LocalAABB = new AABB();
            }
            else
            {
                if (IsReadCompressedColors)
                {
                    Colors = new PackedIntVector();
                }
            }
        }
コード例 #2
0
 public CompressedMesh(Version version)
 {
     Vertices = new PackedFloatVector(true);
     UV       = new PackedFloatVector(true);
     if (HasBindPoses(version))
     {
         BindPoses = new PackedFloatVector(true);
     }
     else
     {
         BindPoses = default;
     }
     Normals      = new PackedFloatVector(true);
     Tangents     = new PackedFloatVector(true);
     Weights      = new PackedIntVector(true);
     NormalSigns  = new PackedIntVector(true);
     TangentSigns = new PackedIntVector(true);
     if (HasFloatColors(version))
     {
         FloatColors = new PackedFloatVector(true);
     }
     else
     {
         FloatColors = default;
     }
     BoneIndices = new PackedIntVector(true);
     Triangles   = new PackedIntVector(true);
     if (HasColors(version))
     {
         Colors = new PackedIntVector(true);
     }
     else
     {
         Colors = default;
     }
     UVInfo = default;
 }