Exemplo n.º 1
0
        /// /////////////////////////////////////////////////////////
        /// Caching
        /// /////////////////////////////////////////////////////////

        // Start cache fragment meshes. Instant or runtime
        static void CacheRuntime(RayfireRigid scr)
        {
            // Reuse existing cache
            if (scr.reset.action == RFReset.PostDemolitionType.DeactivateToReset && scr.reset.mesh == RFReset.MeshResetType.ReuseFragmentMeshes)
            {
                if (scr.HasMeshes == true)
                {
                    return;
                }
            }

            // Clear all mesh data
            scr.DeleteCache();

            // Cache meshes
            if (scr.meshDemolition.runtimeCaching.type == CachingType.Disable)
            {
                CacheInstant(scr);
            }
            else
            {
                scr.CacheFrames();
            }
        }