修改水

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

@@ -9,8 +9,8 @@ namespace Obi
{
public interface IBurstConstraintsImpl : IConstraints
{
JobHandle Initialize(JobHandle inputDeps, float stepTime, float substepTime, int steps, float timeLeft);
JobHandle Project(JobHandle inputDeps, float stepTime, float substepTime, int steps, float timeLeft);
JobHandle Initialize(JobHandle inputDeps, float substepTime);
JobHandle Project(JobHandle inputDeps, float stepTime, float substepTime, int substeps);
void Dispose();
IConstraintsBatchImpl CreateConstraintsBatch();
@@ -63,14 +63,14 @@ namespace Obi
return count;
}
public JobHandle Initialize(JobHandle inputDeps, float stepTime, float substepTime, int steps, float timeLeft)
public JobHandle Initialize(JobHandle inputDeps, float substepTime)
{
// initialize all batches in parallel:
if (batches.Count > 0)
{
NativeArray<JobHandle> deps = new NativeArray<JobHandle>(batches.Count, Allocator.TempJob, NativeArrayOptions.UninitializedMemory);
for (int i = 0; i < batches.Count; ++i)
deps[i] = batches[i].enabled ? batches[i].Initialize(inputDeps, stepTime, substepTime, steps, timeLeft) : inputDeps;
deps[i] = batches[i].enabled ? batches[i].Initialize(inputDeps, substepTime) : inputDeps;
JobHandle result = JobHandle.CombineDependencies(deps);
deps.Dispose();
@@ -81,7 +81,7 @@ namespace Obi
return inputDeps;
}
public JobHandle Project(JobHandle inputDeps, float stepTime, float substepTime, int steps, float timeLeft)
public JobHandle Project(JobHandle inputDeps, float stepTime, float substepTime, int substeps)
{
UnityEngine.Profiling.Profiler.BeginSample("Project");
@@ -90,11 +90,11 @@ namespace Obi
switch(parameters.evaluationOrder)
{
case Oni.ConstraintParameters.EvaluationOrder.Sequential:
inputDeps = EvaluateSequential(inputDeps, stepTime, substepTime, steps, timeLeft);
inputDeps = EvaluateSequential(inputDeps, stepTime, substepTime, substeps);
break;
case Oni.ConstraintParameters.EvaluationOrder.Parallel:
inputDeps = EvaluateParallel(inputDeps, stepTime, substepTime, steps, timeLeft);
inputDeps = EvaluateParallel(inputDeps, stepTime, substepTime, substeps);
break;
}
@@ -103,14 +103,14 @@ namespace Obi
return inputDeps;
}
protected virtual JobHandle EvaluateSequential(JobHandle inputDeps, float stepTime, float substepTime,int steps, float timeLeft)
protected virtual JobHandle EvaluateSequential(JobHandle inputDeps, float stepTime, float substepTime,int substeps)
{
// evaluate and apply all batches:
for (int i = 0; i < batches.Count; ++i)
{
if (batches[i].enabled)
{
inputDeps = batches[i].Evaluate(inputDeps, stepTime, substepTime, steps, timeLeft);
inputDeps = batches[i].Evaluate(inputDeps, stepTime, substepTime, substeps);
inputDeps = batches[i].Apply(inputDeps, substepTime);
m_Solver.ScheduleBatchedJobsIfNeeded();
}
@@ -119,13 +119,13 @@ namespace Obi
return inputDeps;
}
protected virtual JobHandle EvaluateParallel(JobHandle inputDeps, float stepTime, float substepTime, int steps, float timeLeft)
protected virtual JobHandle EvaluateParallel(JobHandle inputDeps, float stepTime, float substepTime, int substeps)
{
// evaluate all batches:
for (int i = 0; i < batches.Count; ++i)
if (batches[i].enabled)
{
inputDeps = batches[i].Evaluate(inputDeps, stepTime, substepTime, steps, timeLeft);
inputDeps = batches[i].Evaluate(inputDeps, stepTime, substepTime, substeps);
m_Solver.ScheduleBatchedJobsIfNeeded();
}