예제 #1
0
        public Task FromModelAsync(ObjectInputSettings ObjSettings, Object3D model, TextureFormatSettings texFormatSettings = null)
        {
            var t = new Task(() => FromModel(ObjSettings, model, texFormatSettings));

            t.Start();
            return(t);
        }
예제 #2
0
        /// <summary>
        /// Creates a Fast3D Model from a Obj File
        /// </summary>
        public void FromModel(ObjectInputSettings ObjSettings, Object3D model, TextureFormatSettings texFormatSettings = null)
        {
            // Setup Settings
            var conSettings = new Conversion.Fast3DWriting.Fast3DWriter.ConvertSettings()
            {
                CenterModel      = ObjSettings.CenterModel,
                Scale            = ObjSettings.Scaling,
                ResizeTextures   = ObjSettings.ResizeTextures,
                ReduceVertLevel  = (Conversion.Fast3DWriting.Fast3DWriter.ReduceVericesLevel)ObjSettings.ReduceDupVertLevel,
                SegmentedAddress = (uint?)0xE000000,
                ForceDisplaylist = ObjSettings.ForceDisplaylist,
                Fog = ObjSettings.Fog,
                OptimizeTransparencyChecks = ObjSettings.OptimizeTransparencyChecks,
                TextureFormatSettings      = texFormatSettings
            };

            model.Shading = ObjSettings.Shading;

            // Convert Model
            var con = new Conversion.Fast3DWriting.Fast3DWriter();

            ConvertResult = con.ConvertModel(this, conSettings, model);

            // Fit to align
            base.SetLength(General.HexRoundUp1(base.Length));

            // Copy Geopointer etc.
            DLPointers      = ConvertResult.PtrGeometry.ToArray();
            Fast3DBankStart = 0xE000000;
        }
예제 #3
0
        public Task FromModelAsync(ObjectInputSettings ObjSettings, Pilz.S3DFileParser.Object3D vmap, Pilz.S3DFileParser.Object3D colmap, Fast3D.TextureFormatSettings texFormatSettings = null, Collision.CollisionSettings colSettings = null)
        {
            var t = new Task(() => FromModel(ObjSettings, vmap, colmap, texFormatSettings, colSettings));

            t.Start();
            return(t);
        }
예제 #4
0
        public void FromModel(ObjectInputSettings ObjSettings, Pilz.S3DFileParser.Object3D vmap, Pilz.S3DFileParser.Object3D colmap, Fast3D.TextureFormatSettings texFormatSettings, Collision.CollisionSettings colSettings = null)
        {
            // Add Collision
            Collision = new Collision.CollisionMap();
            Collision.FromObject3D(ObjSettings, colmap, colSettings);

            // Add Fast3DBuffer (replacement for 'Add Displaylists')
            if (Fast3DBuffer is object)
            {
                Fast3DBuffer.Close();
            }
            Fast3DBuffer = new Fast3D.Fast3DBuffer();
            Fast3DBuffer.FromModel(ObjSettings, vmap, texFormatSettings);
        }