예제 #1
0
        public override IObiConstraintsBatch Clone(IObiConstraints constraints)
        {
            var clone = new ObiAerodynamicConstraintsBatch(constraints as ObiAerodynamicConstraintsData, this);

            clone.particleIndices.ResizeUninitialized(particleIndices.count);
            clone.aerodynamicCoeffs.ResizeUninitialized(aerodynamicCoeffs.count);

            clone.particleIndices.CopyFrom(particleIndices);
            clone.aerodynamicCoeffs.CopyFrom(aerodynamicCoeffs);

            return(clone);
        }
        protected virtual IEnumerator CreateAerodynamicConstraints()
        {
            aerodynamicConstraintsData = new ObiAerodynamicConstraintsData();
            var aeroBatch = new ObiAerodynamicConstraintsBatch();

            aerodynamicConstraintsData.AddBatch(aeroBatch);

            for (int i = 0; i < topology.vertices.Count; i++)
            {
                aeroBatch.AddConstraint(i, areaContribution[i], 1, 1);

                if (i % 500 == 0)
                {
                    yield return(new CoroutineJob.ProgressInfo("ObiCloth: generating aerodynamic constraints...", i / (float)topology.vertices.Count));
                }
            }

            // Set initial amount of active constraints:
            for (int i = 0; i < aerodynamicConstraintsData.batches.Count; ++i)
            {
                aerodynamicConstraintsData.batches[i].activeConstraintCount = aerodynamicConstraintsData.batches[i].constraintCount;
            }
        }
예제 #3
0
 public ObiAerodynamicConstraintsBatch(ObiAerodynamicConstraintsData constraints = null, ObiAerodynamicConstraintsBatch source = null) : base(source)
 {
     m_Constraints = constraints;
 }
 public ObiAerodynamicConstraintsBatch(ObiAerodynamicConstraintsBatch source = null) : base(source)
 {
 }