Exemplo n.º 1
0
        public override void ConsumeDataSegments(AbstractExternalLoader[] externalData)
        {
            foreach (var externalLoader in externalData)
            {
                var ownerGuid = externalLoader.OwnerGuid;
                foreach (var mesh in Meshes)
                {
                    if (ownerGuid != mesh.Guid)
                    {
                        continue;
                    }
                    var editData = externalLoader as ExternalLoader <MeshEditData>;
                    if (editData != null)
                    {
                        mesh.EditData = editData;
                        continue;
                    }
                    var vertexStream = externalLoader as ExternalLoader <VertexStreamData>;
                    if (vertexStream != null)
                    {
                        mesh.VertexStream = vertexStream;
                    }
                }

                var editmodeData = externalLoader as ExternalLoader <EditmodeMiscData>;
                if (editmodeData != null)
                {
                    EditmodeMisc = editmodeData;
                }
            }

            foreach (var mesh in Meshes)
            {
                if (mesh.VertexStream == null)
                {
                    continue;
                }

                if (Version >= 1)
                {
                    mesh.VertexStream.UserData[VertexStreamData.KEY_HAS_QTANGENT] = true;
                }

                var vertCount = mesh.VertexCount;
                if (vertCount >= UInt16.MaxValue)
                {
                    mesh.VertexStream.UserData[VertexStreamData.KEY_IS_32BIT_INDEX] = true;
                }
            }
            base.ConsumeDataSegments(externalData);
        }
Exemplo n.º 2
0
        public override void ConsumeDataSegments(AbstractExternalLoader[] externalData)
        {
            foreach (var externalLoader in externalData)
            {
                var defin = externalLoader as ExternalLoader <SkeletonDefinitionData>;
                if (defin != null)
                {
                    Definition = defin;
                }

                var user = externalLoader as ExternalLoader <SkeletonUserData>;
                if (user != null)
                {
                    UserData = user;
                }
            }

            base.ConsumeDataSegments(externalData);
        }
Exemplo n.º 3
0
        public static bool CreateTypedLoader(Guid typeGuid, FileInfo file, out AbstractExternalLoader result)
        {
#if NETSTANDARD1_3
            AbstractExternalLoader loader = null;
            bool isFound = true;
            if (typeGuid == PhysicsDescriptionData.TYPE_GUID)
            {
                loader = new ExternalLoader <PhysicsDescriptionData>(file);
            }
            else
            {
                loader  = new ExternalLoader <ExternalData>(file);
                isFound = false;
            }
            loader.TypeGuid = typeGuid;
            result          = loader;

            return(isFound);
#else
            AbstractExternalLoader loader = null;
            bool isFound = false;
            if (guidToLoaderTypeMap.ContainsKey(typeGuid))
            {
                var constructor = guidToLoaderConstructorMap[typeGuid];
                loader  = (AbstractExternalLoader)constructor.Invoke(new [] { file });
                isFound = true;
            }
            else
            {
                loader = new ExternalLoader <ExternalData>(file);
            }
            loader.TypeGuid = typeGuid;
            result          = loader;
            return(isFound);
#endif
        }