修改水
This commit is contained in:
@@ -10,8 +10,7 @@ namespace Obi
|
||||
|
||||
void UpdateWorld(float deltaTime);
|
||||
|
||||
void SetColliders(ObiNativeColliderShapeList shapes, ObiNativeAabbList bounds, ObiNativeAffineTransformList transforms);
|
||||
void SetForceZones(ObiNativeForceZoneList forceZones);
|
||||
void SetColliders(ObiNativeColliderShapeList shapes, ObiNativeAabbList bounds, ObiNativeAffineTransformList transforms, int count);
|
||||
void SetRigidbodies(ObiNativeRigidbodyList rigidbody);
|
||||
|
||||
void SetCollisionMaterials(ObiNativeCollisionMaterialList materials);
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 22a8bac3a0d2747b8ba78f201d67476a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e9bb708333a524266935df041ba30a42
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,99 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd2ee05999916460aa9ee269dc8136e4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,4 +1,4 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
@@ -11,14 +11,13 @@ namespace Obi
|
||||
#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);
|
||||
void 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; }
|
||||
void InterpolateDiffuseProperties(ObiNativeVector4List properties, ObiNativeVector4List diffusePositions, ObiNativeVector4List diffuseProperties, ObiNativeIntList neighbourCount, int diffuseCount);
|
||||
#endregion
|
||||
|
||||
#region Rigidbodies
|
||||
@@ -29,36 +28,33 @@ namespace Obi
|
||||
IConstraintsBatchImpl CreateConstraintsBatch(Oni.ConstraintType type);
|
||||
void DestroyConstraintsBatch(IConstraintsBatchImpl batch);
|
||||
int GetConstraintCount(Oni.ConstraintType type);
|
||||
void GetCollisionContacts(Oni.Contact[] contacts, int count);
|
||||
void GetParticleCollisionContacts(Oni.Contact[] contacts, int count);
|
||||
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);
|
||||
IObiJobHandle CollisionDetection(float stepTime);
|
||||
IObiJobHandle Substep(float stepTime, float substepTime, int substeps);
|
||||
void ApplyInterpolation(ObiNativeVector4List startPositions, ObiNativeQuaternionList startOrientations, float stepTime, float unsimulatedTime);
|
||||
#endregion
|
||||
|
||||
#region Simplices
|
||||
int GetDeformableTriangleCount();
|
||||
void SetDeformableTriangles(int[] indices, int num, int destOffset);
|
||||
int RemoveDeformableTriangles(int num, int sourceOffset);
|
||||
|
||||
void SetSimplices(ObiNativeIntList simplices, SimplexCounts counts);
|
||||
#endregion
|
||||
|
||||
#region Utils
|
||||
void SetParameters(Oni.SolverParameters parameters);
|
||||
void GetBounds(ref Vector3 min, ref Vector3 max);
|
||||
void ResetForces();
|
||||
int GetParticleGridSize();
|
||||
void GetParticleGrid(ObiNativeAabbList cells);
|
||||
void SpatialQuery(ObiNativeQueryShapeList shapes, ObiNativeAffineTransformList transforms, ObiNativeQueryResultList results);
|
||||
void ReleaseJobHandles();
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user