修改水

This commit is contained in:
2026-01-01 22:00:33 +08:00
parent 040a222bd6
commit 9ceffccd39
1800 changed files with 103929 additions and 139495 deletions

View File

@@ -8,8 +8,8 @@ namespace Obi
{
Oni.ConstraintType? GetConstraintType();
IObiConstraintsBatch GetBatch(int i);
int batchCount { get; }
IObiConstraintsBatch GetBatch(int i);
int GetBatchCount();
void Clear();
bool AddToSolver(ObiSolver solver);
@@ -17,7 +17,6 @@ namespace Obi
int GetConstraintCount();
int GetActiveConstraintCount();
void ActivateAllConstraints();
void DeactivateAllConstraints();
void Merge(ObiActor actor, IObiConstraints other);
@@ -29,8 +28,6 @@ namespace Obi
[NonSerialized] protected ObiSolver m_Solver;
[HideInInspector] public List<T> batches = new List<T>();
public int batchCount { get => batches == null ? 0 : batches.Count; }
// merges constraints from a given actor with this one.
public void Merge(ObiActor actor, IObiConstraints other)
{
@@ -45,11 +42,11 @@ namespace Obi
actor.solverBatchOffsets[constraintType].Clear();
// create new empty batches if needed:
int newBatches = Mathf.Max(0, others.batchCount - batchCount);
int newBatches = Mathf.Max(0, others.GetBatchCount() - GetBatchCount());
for (int i = 0; i < newBatches; ++i)
AddBatch(CreateBatch());
for (int i = 0; i < other.batchCount; ++i)
for (int i = 0; i < other.GetBatchCount(); ++i)
{
// store this batch's offset:
actor.solverBatchOffsets[constraintType].Add(batches[i].activeConstraintCount);
@@ -67,6 +64,11 @@ namespace Obi
return null;
}
public int GetBatchCount()
{
return batches == null ? 0 : batches.Count;
}
public int GetConstraintCount()
{
int count = 0;
@@ -99,14 +101,6 @@ namespace Obi
batch.DeactivateAllConstraints();
}
public void ActivateAllConstraints()
{
if (batches != null)
foreach (T batch in batches)
if (batch != null)
batch.ActivateAllConstraints();
}
public T GetFirstBatch()
{
return (batches != null && batches.Count > 0) ? batches[0] : null;