public override void PushDataToSolver(ObiBatchedConstraints constraints)
        {
            if (constraints == null || constraints.Actor == null || !constraints.Actor.InSolver)
            {
                return;
            }

            ObiAerodynamicConstraints dc = (ObiAerodynamicConstraints)constraints;

            for (int i = 0; i < aerodynamicCoeffs.Count; i += 3)
            {
                aerodynamicCoeffs[i + 1] = dc.dragCoefficient * dc.airDensity;
                aerodynamicCoeffs[i + 2] = dc.liftCoefficient * dc.airDensity;
            }

            Oni.SetAerodynamicConstraints(batch, solverIndices, aerodynamicCoeffs.ToArray(), ConstraintCount);
        }
        protected override void OnRemoveFromSolver(object info)
        {
            ObiSolver solver = actor.solver;

            // subtract our amount of constraints from other actor's offsets:
            for (int i = actor.actorID + 1; i < solver.actors.Count; i++)
            {
                ObiAerodynamicConstraints ac = solver.actors[i].GetComponent <ObiAerodynamicConstraints>();
                if (ac != null)
                {
                    ac.UpdateIndicesOffset(ac.indicesOffset - aerodynamicNormals.Count);
                }
            }

            ObiUtils.RemoveRange(ref solver.aerodynamicConstraints.aerodynamicIndices, indicesOffset, aerodynamicIndices.Count);
            ObiUtils.RemoveRange(ref solver.aerodynamicConstraints.aerodynamicNormals, indicesOffset, aerodynamicNormals.Count);
            ObiUtils.RemoveRange(ref solver.aerodynamicConstraints.wind, indicesOffset, wind.Count);
            ObiUtils.RemoveRange(ref solver.aerodynamicConstraints.aerodynamicCoeffs, indicesOffset * 3, aerodynamicCoeffs.Count);
        }
 public void OnEnable()
 {
     constraints = (ObiAerodynamicConstraints)target;
 }