添加插件

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,15 @@
#if (OBI_BURST && OBI_MATHEMATICS && OBI_COLLECTIONS)
using System;
using Unity.Mathematics;
namespace Obi
{
public struct CohesionKernel
{
public float W(float r, float h)
{
return math.cos(math.min(r, h) * 3 * math.PI / (2 * h));
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d2bcf975ae59e4fcf9412ec328a3e2b9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,36 @@
#if (OBI_BURST && OBI_MATHEMATICS && OBI_COLLECTIONS)
using System;
using Unity.Mathematics;
namespace Obi
{
public struct Poly6Kernel
{
public float norm;
public bool norm2D;
public Poly6Kernel(bool norm2D)
{
this.norm2D = norm2D;
if (norm2D)
norm = 4.0f / math.PI;
else
norm = 315.0f / (64.0f * math.PI);
}
public float W(float r, float h)
{
float h2 = h * h;
float h4 = h2 * h2;
float h8 = h4 * h4;
float rl = math.min(r, h);
float hr = h2 - rl * rl;
if (norm2D)
return norm / h8 * hr * hr * hr;
return norm / (h8 * h) * hr * hr * hr;
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7a3990134524143ac852b488554f6d4e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,35 @@
#if (OBI_BURST && OBI_MATHEMATICS && OBI_COLLECTIONS)
using System;
using Unity.Mathematics;
namespace Obi
{
public struct SpikyKernel
{
public float norm;
public bool norm2D;
public SpikyKernel(bool norm2D)
{
this.norm2D = norm2D;
if (norm2D)
norm = -30.0f / math.PI;
else
norm = -45.0f / math.PI;
}
public float W(float r, float h)
{
float h2 = h * h;
float h4 = h2 * h2;
float rl = math.min(r, h);
float hr = h - rl;
if (norm2D)
return norm / (h4 * h) * hr * hr;
return norm / (h4 * h2) * hr * hr;
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a407989bfa0664e9ab75773d1808f549
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: