添加插件

This commit is contained in:
2025-11-10 00:08:26 +08:00
parent 4059c207c0
commit 76f80db694
2814 changed files with 436400 additions and 178 deletions

View File

@@ -0,0 +1,32 @@
using System;
using UnityEngine;
namespace Obi
{
public class ComputeTetherConstraints : ComputeConstraintsImpl<ComputeTetherConstraintsBatch>
{
public ComputeShader constraintsShader;
public int projectKernel;
public int applyKernel;
public ComputeTetherConstraints(ComputeSolverImpl solver) : base(solver, Oni.ConstraintType.Tether)
{
constraintsShader = GameObject.Instantiate(Resources.Load<ComputeShader>("Compute/TetherConstraints"));
projectKernel = constraintsShader.FindKernel("Project");
applyKernel = constraintsShader.FindKernel("Apply");
}
public override IConstraintsBatchImpl CreateConstraintsBatch()
{
var dataBatch = new ComputeTetherConstraintsBatch(this);
batches.Add(dataBatch);
return dataBatch;
}
public override void RemoveBatch(IConstraintsBatchImpl batch)
{
batches.Remove(batch as ComputeTetherConstraintsBatch);
batch.Destroy();
}
}
}