Update GPUClothSimulator
parent
6b4fd09402
commit
5cde20572e
|
@ -208,4 +208,133 @@ Function
|
|||
------
|
||||
|
||||
# API
|
||||
* To be filled out.
|
||||
## Void InitializeSimulation()
|
||||
+ Call to make the simulation start. This is only needed if you disable the \"Initialization at start\". Leaving this disabled is good for if you instantiate the cloth and need to add colliders. You can add colliders or update constraints then call this.
|
||||
|
||||
## Void UpdateConstraints()
|
||||
+ Call to make the script read the weightmap and recalculate the lists of Vertice masses, Vertice Damping, Pinned Vertices, and the Simulation Vertices.
|
||||
|
||||
## float MMin = 0.0f ; MMax = 1.0f
|
||||
+ This adjusts the minimum and maximum allowed value for the weightmap Vertice masses. When the weightmap is being read and telling each Vertice their mass, it uses a Larp mathematical function.
|
||||
Larp(MMin, MMax, VerticeWeight) - As the weights are read, it is ultimately configured according to the min and max values. The editor is defaulted to MMin 0.0, while max is 1.0. if you change these, it will allow the sliders in the editor to be able to travel further.
|
||||
|
||||
## float CMin = 0.0f ; CMax = 1.0f
|
||||
+ Adjusts the min and max for the Velocity Damping per vertice. please read \"float MMin = 0.0f ; MMax = 1.0f\" for more details on how this works
|
||||
|
||||
## List<float> vertexMasses
|
||||
+ lists each Vertice's mass according to the weightmap. Get/Set enabled.
|
||||
|
||||
## List<float> Constraints
|
||||
+ lists each Vertice's Damping according to the weightmap. Get/Set enabled.
|
||||
|
||||
## List<int> AlphaVertices
|
||||
+ lists each Vertice's Simulation Status according to the weightmap. Get/Set enabled. Largly used to create the Collider Mesh and to optimize the amount of data being called to and from the GPU Compute file.
|
||||
|
||||
## int[] PinnedVertices
|
||||
+ lists each Vertice's Pinned status according to the weightmap. Get/Set enabled. Take note this is not a List like the others.
|
||||
|
||||
## List<MeshColliderHelper> CollidableMeshes
|
||||
+ Use this to add MESH Colliders, or to get the full list of.
|
||||
|
||||
## List<PlaneCollider> CollidablePlanes
|
||||
+ Use this to add PLANE Colliders, or to get the full list of.
|
||||
|
||||
## List<CapsuleColliderHelper> Capsules
|
||||
+ Use this to add CAPSULE Colliders, or to get the full list of.
|
||||
|
||||
## List<SphereColliderHelper> Spheres
|
||||
+ Use this to add SPHERE Colliders, or to get the full list of.
|
||||
|
||||
## List<BoxColliderHelper> Cubes
|
||||
+ Use this to add BOX Colliders, or to get the full list of.
|
||||
|
||||
## List<SphereColliderPair> SphereColliderPairs
|
||||
+ Use this to add SPHERECOLLIDERPAIRS Colliders, or to get the full list of.
|
||||
|
||||
## SkinnedMeshRenderer skinnedMeshRenderer;
|
||||
+ The SkinnedMeshRenderer that is being manipulated. This is filled by the editor script and if it ever detects it null, it will try to set it by using the gameObject it is attached to. If you never click on the gameobject after setting this then you could set the script on any game object, however complicated that may become.
|
||||
|
||||
## List<SerializableVertexMapping> physicsToFullVertexMapping
|
||||
+ this is a list of a class which contains the information on which vertice lines up with which vertice in relation to the main mesh, and the SubMesh which is Created using the Alpha channel on the Weightmap.
|
||||
|
||||
```csharp
|
||||
public class SerializableVertexMapping {
|
||||
public int fullMeshIndex;
|
||||
public int physicsMeshIndex;
|
||||
}
|
||||
-----
|
||||
|
||||
# Structs
|
||||
## Sphere Collider
|
||||
```csharp
|
||||
public struct CollidableSphereStruct {
|
||||
public Vector3 center;
|
||||
public float radius;
|
||||
public float friction;
|
||||
}
|
||||
```
|
||||
## Box Collider
|
||||
```Csharp
|
||||
public struct CollidableCubeStruct {
|
||||
public Vector3 center;
|
||||
public Vector3 rotation;
|
||||
public Vector3 extent;
|
||||
public float friction;
|
||||
}
|
||||
```
|
||||
## Plane Collider
|
||||
```Csharp
|
||||
public struct CollidablePlaneStruct {
|
||||
public Vector3 position;
|
||||
public Vector3 rotation;
|
||||
public Vector3 scale;
|
||||
public Vector3 normal;
|
||||
public float friction;
|
||||
public float thickness;
|
||||
}
|
||||
```
|
||||
## Capsule Collider
|
||||
```csharp
|
||||
public struct CollidableCapsuleStruct {
|
||||
public Vector3 center;
|
||||
public Vector3 rotation;
|
||||
public Vector3 direction;
|
||||
public float radius;
|
||||
public float length;
|
||||
public float friction;
|
||||
}
|
||||
```
|
||||
## Mesh Colliders
|
||||
```Csharp
|
||||
public struct CollidableMeshStruct {
|
||||
public int vertexStartIndex;
|
||||
public int triangleStartIndex;
|
||||
public int vertexCount;
|
||||
public int triangleCount;
|
||||
public float friction;
|
||||
}
|
||||
```
|
||||
## Sphere Collider Pairs
|
||||
```Csharp
|
||||
public struct CollidableSpherePairStruct {
|
||||
public Vector3 centerA;
|
||||
public float radiusA;
|
||||
public Vector3 centerB;
|
||||
public float radiusB;
|
||||
public float friction;
|
||||
}
|
||||
```
|
||||
-----
|
||||
|
||||
# Enums
|
||||
## Damping Methods
|
||||
+ public enum DampingMethod { noDamping, simpleDamping, smartDamping, Weightmap }
|
||||
|
||||
## Bending Methods
|
||||
+ public enum BendingMethod { DihedralBending, isometricBending }
|
||||
|
||||
## Gravity Direction
|
||||
+ public enum GravityDirection { XPlus, YPlus, ZPlus, XMinus, YMinus, ZMinus }
|
||||
|
||||
## Work Group Size
|
||||
+ public enum WorkGroupSize { X8 = 8, X16 = 16, X32 = 32, X64 = 64, X128 = 128, X256 = 256, X512 = 512 }
|
Loading…
Reference in New Issue
Block a user