Beispiel #1
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)
            {
                lambdas.Clear();
                for (int i = 0; i < skinCompliance.count; i++)
                {
                    particleIndices[i] = constraints.GetActor().solverIndices[m_Source.particleIndices[i]];
                    lambdas.Add(0);
                }

                m_BatchImpl.SetSkinConstraints(particleIndices, skinPoints, skinNormals, skinRadiiBackstop, skinCompliance, lambdas, m_ConstraintCount);
                m_BatchImpl.SetActiveConstraints(m_ActiveConstraintCount);
            }

            /*for (int i = 0; i < skinCompliance.count; i++)
             * {
             *  particleIndices[i] = constraints.GetActor().solverIndices[m_Source.particleIndices[i]];
             * }*/

            // pass constraint data arrays to the solver:
            //Oni.SetSkinConstraints(batch, particleIndices.GetIntPtr(), skinPoints.GetIntPtr(), skinNormals.GetIntPtr(), skinRadiiBackstop.GetIntPtr(), skinCompliance.GetIntPtr(), m_ConstraintCount);
            //Oni.SetActiveConstraints(batch, m_ActiveConstraintCount);
        }
Beispiel #2
0
        public override void AddToSolver(ObiSolver solver)
        {
            // Create distance constraints batch directly.
            m_BatchImpl = solver.implementation.CreateConstraintsBatch(constraintType) as ISkinConstraintsBatchImpl;

            if (m_BatchImpl != null)
            {
                m_BatchImpl.SetSkinConstraints(particleIndices, skinPoints, skinNormals, skinRadiiBackstop, skinCompliance, lambdas, m_ActiveConstraintCount);
            }
        }
Beispiel #3
0
 public void RemoveBatch(ISkinConstraintsBatchImpl batch)
 {
     batches.Remove(batch as BurstSkinConstraintsBatch);
 }