Files
HauntedBloodlines/Assets/Obi/Scripts/Common/Backends/Burst/Constraints/ParticleCollision/BurstParticleFrictionConstraints.cs
2025-05-29 22:31:40 +03:00

33 lines
1.0 KiB
C#

#if (OBI_BURST && OBI_MATHEMATICS && OBI_COLLECTIONS)
using System;
namespace Obi
{
public class BurstParticleFrictionConstraints : BurstConstraintsImpl<BurstParticleFrictionConstraintsBatch>
{
public BurstParticleFrictionConstraints(BurstSolverImpl solver) : base(solver, Oni.ConstraintType.ParticleFriction)
{
}
public override IConstraintsBatchImpl CreateConstraintsBatch()
{
var dataBatch = new BurstParticleFrictionConstraintsBatch(this);
batches.Add(dataBatch);
return dataBatch;
}
public override void RemoveBatch(IConstraintsBatchImpl batch)
{
batches.Remove(batch as BurstParticleFrictionConstraintsBatch);
batch.Destroy();
}
public override int GetConstraintCount()
{
if (!((BurstSolverImpl)solver).particleContacts.IsCreated)
return 0;
return ((BurstSolverImpl)solver).particleContacts.Length;
}
}
}
#endif