Пример #1
0
        private agxSDK.Simulation GetOrCreateSimulation()
        {
            if (m_simulation == null)
            {
                NativeHandler.Instance.MakeMainThread();

                m_simulation = new agxSDK.Simulation();

                m_defaultNumDryFrictionIterations = (int)m_simulation.getSolver().getNumDryFrictionIterations();
                m_defaultNumRestingIterations     = (int)m_simulation.getSolver().getNumRestingIterations();

                m_space  = m_simulation.getSpace();
                m_system = m_simulation.getDynamicsSystem();

                m_system.setEnableContactWarmstarting(m_warmStartingDirectContacts);
            }

            return(m_simulation);
        }
Пример #2
0
        public SolverSettings RestoreLocalDataFrom(agxSDK.Simulation simulation)
        {
            var solver = simulation.getSolver();
            var config = solver.getNlMcpConfig();

            NumberOfThreads         = System.Convert.ToInt32(agx.agxSWIG.getNumThreads());
            WarmStartDirectContacts = simulation.getDynamicsSystem().getUpdateTask().getSubtask("MatchContactStates").isEnabled();
            RestingIterations       = System.Convert.ToInt32(solver.getNumRestingIterations());
            DryFrictionIterations   = System.Convert.ToInt32(solver.getNumDryFrictionIterations());
            McpAlgorithm            = Convert(config.mcpAlgorithmType);
            McpInnerIterations      = System.Convert.ToInt32(config.numMcpIterations);
            McpInnerTolerance       = System.Convert.ToSingle(config.mcpTolerance);
            McpOuterIterations      = System.Convert.ToInt32(config.numOuterIterations);
            McpOuterTolerance       = System.Convert.ToSingle(config.outerTolerance);

            return(this);
        }