public override void AddToSolver(ObiSolver solver)
        {
            // Create distance constraints batch directly.
            m_BatchImpl = solver.implementation.CreateConstraintsBatch(constraintType) as IAerodynamicConstraintsBatchImpl;

            if (m_BatchImpl != null)
            {
                m_BatchImpl.SetAerodynamicConstraints(particleIndices, aerodynamicCoeffs, m_ActiveConstraintCount);
            }
        }
Esempio n. 2
0
        public override void AddToSolver()
        {
            // create and add the implementation:
            if (m_Constraints != null && m_Constraints.implementation != null)
            {
                m_BatchImpl = m_Constraints.implementation.CreateConstraintsBatch();
            }

            if (m_BatchImpl != null)
            {
                for (int i = 0; i < particleIndices.count; i++)
                {
                    particleIndices[i] = constraints.GetActor().solverIndices[m_Source.particleIndices[i]];
                }

                m_BatchImpl.SetAerodynamicConstraints(particleIndices, aerodynamicCoeffs, m_ConstraintCount);
                m_BatchImpl.SetActiveConstraints(m_ActiveConstraintCount);
            }
        }