添加插件
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26d4fb7ae70404953b2fe6daed5564d7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using Unity.Jobs;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IColliderWorldImpl
|
||||
{
|
||||
int referenceCount { get; }
|
||||
|
||||
void UpdateWorld(float deltaTime);
|
||||
|
||||
void SetColliders(ObiNativeColliderShapeList shapes, ObiNativeAabbList bounds, ObiNativeAffineTransformList transforms);
|
||||
void SetForceZones(ObiNativeForceZoneList forceZones);
|
||||
void SetRigidbodies(ObiNativeRigidbodyList rigidbody);
|
||||
|
||||
void SetCollisionMaterials(ObiNativeCollisionMaterialList materials);
|
||||
|
||||
void SetTriangleMeshData(ObiNativeTriangleMeshHeaderList headers, ObiNativeBIHNodeList nodes, ObiNativeTriangleList triangles, ObiNativeVector3List vertices);
|
||||
void SetEdgeMeshData(ObiNativeEdgeMeshHeaderList headers, ObiNativeBIHNodeList nodes, ObiNativeEdgeList triangles, ObiNativeVector2List vertices);
|
||||
void SetDistanceFieldData(ObiNativeDistanceFieldHeaderList headers, ObiNativeDFNodeList nodes);
|
||||
void SetHeightFieldData(ObiNativeHeightFieldHeaderList headers, ObiNativeFloatList samples);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89f411e99368641bda6ba6dd0864c8c6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using Unity.Jobs;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IColliderWorldImpl
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
void UpdateWorld(float deltaTime);
|
||||
=======
|
||||
int referenceCount { get; }
|
||||
|
||||
void UpdateWorld();
|
||||
>>>>>>> 56Hotfix
|
||||
|
||||
void SetColliders(ObiNativeColliderShapeList shapes, ObiNativeAabbList bounds, ObiNativeAffineTransformList transforms, int count);
|
||||
void SetRigidbodies(ObiNativeRigidbodyList rigidbody);
|
||||
|
||||
void SetCollisionMaterials(ObiNativeCollisionMaterialList materials);
|
||||
|
||||
void SetTriangleMeshData(ObiNativeTriangleMeshHeaderList headers, ObiNativeBIHNodeList nodes, ObiNativeTriangleList triangles, ObiNativeVector3List vertices);
|
||||
void SetEdgeMeshData(ObiNativeEdgeMeshHeaderList headers, ObiNativeBIHNodeList nodes, ObiNativeEdgeList triangles, ObiNativeVector2List vertices);
|
||||
void SetDistanceFieldData(ObiNativeDistanceFieldHeaderList headers, ObiNativeDFNodeList nodes);
|
||||
void SetHeightFieldData(ObiNativeHeightFieldHeaderList headers, ObiNativeFloatList samples);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a37affa245de4938b08eb9ff13f2c13
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92371fdf7eced49a58fe7a78f21d85e0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IAerodynamicConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetAerodynamicConstraints(ObiNativeIntList particleIndices, ObiNativeFloatList aerodynamicCoeffs, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a0f082ce0011f44c68afb3e08a94174f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IBendConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetBendConstraints(ObiNativeIntList particleIndices, ObiNativeFloatList restBends, ObiNativeVector2List bendingStiffnesses, ObiNativeVector2List plasticity, ObiNativeFloatList lambdas, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04ed7586a63754fedac80c4d72ccc001
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IBendTwistConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetBendTwistConstraints(ObiNativeIntList orientationIndices, ObiNativeQuaternionList restDarboux, ObiNativeVector3List stiffnesses, ObiNativeVector2List plasticity, ObiNativeFloatList lambdas, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80c2392ca65914fdbac721d82d5266d5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IChainConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetChainConstraints(ObiNativeIntList particleIndices, ObiNativeVector2List restLengths, ObiNativeIntList firstIndex, ObiNativeIntList numIndex, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51e802e7c035e4ce799a5afb80a5da5c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IColliderCollisionConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bad55e75f72144e6b992f17ad436af57
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IColliderFrictionConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce5da28cc60854096a6af5377bc0b9ba
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IConstraintsBatchImpl
|
||||
{
|
||||
Oni.ConstraintType constraintType
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
IConstraints constraints
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
bool enabled
|
||||
{
|
||||
set;
|
||||
get;
|
||||
}
|
||||
|
||||
void Destroy();
|
||||
void SetConstraintCount(int constraintCount);
|
||||
int GetConstraintCount();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6631e8d65517d4eb7adfaec19126e754
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IConstraints
|
||||
{
|
||||
Oni.ConstraintType constraintType
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
ISolverImpl solver
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
int GetConstraintCount();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8198ad7e2d14140879a794fc8f90e61d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IDensityConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2df20fbf9eee489c9999427bedc7f00
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IDistanceConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetDistanceConstraints(ObiNativeIntList particleIndices, ObiNativeFloatList restLengths, ObiNativeVector2List stiffnesses, ObiNativeFloatList lambdas, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 462485304564147b08d192696258a593
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IParticleCollisionConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e1fef58a2a6c74dd08e04b9df48f028e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IParticleFrictionConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d283cf8766664a728b1a3372c4a423a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IPinConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetPinConstraints(ObiNativeIntList particleIndices, ObiNativeIntList colliderIndices, ObiNativeVector4List offsets, ObiNativeQuaternionList restDarbouxVectors, ObiNativeFloatList stiffnesses, ObiNativeFloatList lambdas, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 339a70e0be9984072a153f58552747e7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IPinholeConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetPinholeConstraints(ObiNativeIntList particleIndices, ObiNativeIntList colliderIndices, ObiNativeVector4List offsets, ObiNativeFloatList edgeMus, ObiNativeIntList edgeRanges, ObiNativeFloatList edgeRangeMus, ObiNativeFloatList parameters, ObiNativeFloatList relativeVelocities, ObiNativeFloatList lambdas, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 22a8bac3a0d2747b8ba78f201d67476a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace Obi
|
||||
{
|
||||
public interface IShapeMatchingConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetShapeMatchingConstraints(ObiNativeIntList particleIndices,
|
||||
ObiNativeIntList firstIndex,
|
||||
ObiNativeIntList numIndices,
|
||||
ObiNativeIntList explicitGroup,
|
||||
ObiNativeFloatList shapeMaterialParameters,
|
||||
ObiNativeVector4List restComs,
|
||||
ObiNativeVector4List coms,
|
||||
ObiNativeQuaternionList orientations,
|
||||
ObiNativeMatrix4x4List linearTransforms,
|
||||
ObiNativeMatrix4x4List plasticDeformations,
|
||||
ObiNativeFloatList lambdas,
|
||||
int count);
|
||||
|
||||
void CalculateRestShapeMatching();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 793544a177038489599056d49197b4b7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface ISkinConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetSkinConstraints(ObiNativeIntList particleIndices, ObiNativeVector4List skinPoints, ObiNativeVector4List skinNormals, ObiNativeFloatList skinRadiiBackstop, ObiNativeFloatList skinCompliance, ObiNativeFloatList lambdas, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c42e394fbac64742a7d3aae172e7750
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IStitchConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetStitchConstraints(ObiNativeIntList particleIndices, ObiNativeFloatList stiffnesses, ObiNativeFloatList lambdas, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f42ef0ded9a564c599a8797894ea1d1e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IStretchShearConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetStretchShearConstraints(ObiNativeIntList particleIndices, ObiNativeIntList orientationIndices, ObiNativeFloatList restLengths, ObiNativeQuaternionList restOrientations, ObiNativeVector3List stiffnesses, ObiNativeFloatList lambdas, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4afb32b230ee849909c3b9b246b6a51e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface ITetherConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetTetherConstraints(ObiNativeIntList particleIndices, ObiNativeVector2List maxLengthScale, ObiNativeFloatList stiffnesses, ObiNativeFloatList lambdas, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b7ea8208967a0450a85e41d98a4f0f57
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IVolumeConstraintsBatchImpl : IConstraintsBatchImpl
|
||||
{
|
||||
void SetVolumeConstraints(ObiNativeIntList triangles,
|
||||
ObiNativeIntList firstTriangle,
|
||||
ObiNativeIntList numTriangles,
|
||||
ObiNativeFloatList restVolumes,
|
||||
ObiNativeVector2List pressureStiffness,
|
||||
ObiNativeFloatList lambdas,
|
||||
int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5f8748ef424c445d949c21d3528e6ee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
18
Assets/Obi/Scripts/Common/Backends/Interface/IObiBackend.cs
Normal file
18
Assets/Obi/Scripts/Common/Backends/Interface/IObiBackend.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
/**
|
||||
* Base class for backend implementations.
|
||||
*/
|
||||
public interface IObiBackend
|
||||
{
|
||||
#region Solver
|
||||
ISolverImpl CreateSolver(ObiSolver solver, int capacity);
|
||||
void DestroySolver(ISolverImpl solver);
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3212c809e81a349d298b283ff8b1f367
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Obi
|
||||
{
|
||||
public interface IObiJobHandle
|
||||
{
|
||||
void Complete();
|
||||
void Release();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f2948e6b45fe44c09866380b7ebb2ff
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
|
||||
/**
|
||||
* Simple pool to avoid allocating job handles at runtime. Only a small number of handles
|
||||
* are expected, so once a handle is borrowed from the pool it cannot be individually returned: all
|
||||
* borrowed handles are returned to the pool at the end of each step.
|
||||
*/
|
||||
public class JobHandlePool<T> where T : IObiJobHandle , new()
|
||||
{
|
||||
private List<T> pool;
|
||||
private int borrowedHandles;
|
||||
|
||||
public JobHandlePool(int initialSize)
|
||||
{
|
||||
borrowedHandles = 0;
|
||||
pool = new List<T>(initialSize);
|
||||
for (int i = 0; i < initialSize; ++i)
|
||||
pool.Add(new T());
|
||||
}
|
||||
|
||||
public T Borrow()
|
||||
{
|
||||
// expand pool if needed (no pool doubling, simply add one extra handle).
|
||||
if (borrowedHandles == pool.Count)
|
||||
pool.Add(new T());
|
||||
|
||||
return pool[borrowedHandles++];
|
||||
}
|
||||
|
||||
public void ReleaseAll()
|
||||
{
|
||||
borrowedHandles = 0;
|
||||
for (int i = 0; i < pool.Count; ++i)
|
||||
pool[i].Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41815ed20fd8a498ca433a2d90ee1136
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e9bb708333a524266935df041ba30a42
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface IRenderSystem
|
||||
{
|
||||
void Setup(); // build meshes, prepare render state, etc.
|
||||
void Step(); // update constraints (currently only used by skinned cloth)
|
||||
void Render(); // do the actual rendering.
|
||||
|
||||
void Dispose();
|
||||
|
||||
uint tier { get { return 1; } }
|
||||
Oni.RenderingSystemType typeEnum { get; }
|
||||
|
||||
bool isEmpty { get; }
|
||||
Type GetRendererType();
|
||||
}
|
||||
|
||||
public class RendererSet<T> where T : ObiRenderer<T>
|
||||
{
|
||||
private List<T> list = new List<T>();
|
||||
|
||||
public T this[int i]
|
||||
{
|
||||
get { return list[i]; }
|
||||
set { list[i] = value; }
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get { return list.Count; }
|
||||
}
|
||||
|
||||
public bool AddRenderer(T renderer)
|
||||
{
|
||||
// Even though using a HashSet would keep us from checking for
|
||||
// duplicates in O(n), the only way to iterate trough a set
|
||||
// causes GC. Since we iterate trough renderers every frame,
|
||||
// but we only add new renderers once in a blue moon,
|
||||
// it's preferable to use a list instead.
|
||||
|
||||
if (!list.Contains(renderer))
|
||||
{
|
||||
list.Add(renderer);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool RemoveRenderer(T renderer)
|
||||
{
|
||||
return list.Remove(renderer);
|
||||
}
|
||||
|
||||
public void RemoveAt(int i)
|
||||
{
|
||||
if (i >= 0 && i < list.Count)
|
||||
list.RemoveAt(i);
|
||||
}
|
||||
|
||||
public int IndexOf(T renderer)
|
||||
{
|
||||
return list.IndexOf(renderer);
|
||||
}
|
||||
|
||||
public IReadOnlyList<T> AsReadOnly()
|
||||
{
|
||||
return list.AsReadOnly();
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
list.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public interface RenderSystem<T> : IRenderSystem where T : ObiRenderer<T>
|
||||
{
|
||||
RendererSet<T> renderers { get; }
|
||||
|
||||
Type IRenderSystem.GetRendererType() { return typeof(T); }
|
||||
|
||||
bool IRenderSystem.isEmpty
|
||||
{
|
||||
get { return renderers.Count == 0; }
|
||||
}
|
||||
|
||||
public virtual bool AddRenderer(T renderer)
|
||||
{
|
||||
return renderers.AddRenderer(renderer);
|
||||
}
|
||||
public virtual bool RemoveRenderer(T renderer)
|
||||
{
|
||||
return renderers.RemoveRenderer(renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd2ee05999916460aa9ee269dc8136e4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Obi/Scripts/Common/Backends/Interface/Solver.meta
Normal file
8
Assets/Obi/Scripts/Common/Backends/Interface/Solver.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05a823cecfaf946f7ab1f11139245d20
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,64 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public interface ISolverImpl
|
||||
{
|
||||
#region Lifecycle
|
||||
void Destroy();
|
||||
#endregion
|
||||
|
||||
#region Inertial Frame
|
||||
void InitializeFrame(Vector4 translation, Vector4 scale, Quaternion rotation);
|
||||
void UpdateFrame(Vector4 translation, Vector4 scale, Quaternion rotation, float deltaTime);
|
||||
IObiJobHandle ApplyFrame(float worldLinearInertiaScale, float worldAngularInertiaScale, float deltaTime);
|
||||
#endregion
|
||||
|
||||
#region Particles
|
||||
void ParticleCountChanged(ObiSolver solver);
|
||||
void MaxFoamParticleCountChanged(ObiSolver solver);
|
||||
void SetActiveParticles(ObiNativeIntList indices);
|
||||
uint activeFoamParticleCount { get; }
|
||||
#endregion
|
||||
|
||||
#region Rigidbodies
|
||||
void SetRigidbodyArrays(ObiSolver solver);
|
||||
#endregion
|
||||
|
||||
#region Constraints
|
||||
IConstraintsBatchImpl CreateConstraintsBatch(Oni.ConstraintType type);
|
||||
void DestroyConstraintsBatch(IConstraintsBatchImpl batch);
|
||||
int GetConstraintCount(Oni.ConstraintType type);
|
||||
void SetConstraintGroupParameters(Oni.ConstraintType type, ref Oni.ConstraintParameters parameters);
|
||||
#endregion
|
||||
|
||||
#region Update
|
||||
IObiJobHandle UpdateBounds(IObiJobHandle inputDeps, float stepTime);
|
||||
IObiJobHandle CollisionDetection(IObiJobHandle inputDeps, float stepTime);
|
||||
IObiJobHandle Substep(IObiJobHandle inputDeps, float stepTime, float substepTime, int steps, float timeLeft);
|
||||
IObiJobHandle ApplyInterpolation(IObiJobHandle inputDeps, ObiNativeVector4List startPositions, ObiNativeQuaternionList startOrientations, float stepTime, float unsimulatedTime);
|
||||
|
||||
void FinishSimulation();
|
||||
void PushData();
|
||||
void RequestReadback();
|
||||
#endregion
|
||||
|
||||
#region Deformable shapes
|
||||
void SetDeformableTriangles(ObiNativeIntList indices, ObiNativeVector2List uvs);
|
||||
void SetDeformableEdges(ObiNativeIntList indices);
|
||||
#endregion
|
||||
|
||||
#region Simplices
|
||||
void SetSimplices(ObiNativeIntList simplices, SimplexCounts counts);
|
||||
#endregion
|
||||
|
||||
#region Utils
|
||||
void SetParameters(Oni.SolverParameters parameters);
|
||||
void GetBounds(ref Vector3 min, ref Vector3 max);
|
||||
int GetParticleGridSize();
|
||||
void GetParticleGrid(ObiNativeAabbList cells);
|
||||
void SpatialQuery(ObiNativeQueryShapeList shapes, ObiNativeAffineTransformList transforms, ObiNativeQueryResultList results);
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e99a50686df1a44519aa29d8424d670e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user