Add SphereColliderPair

Schaken 2025-01-21 17:37:38 -05:00
parent 5cc91c32bd
commit ca39484e58

40
SphereColliderPair.md Normal file

@ -0,0 +1,40 @@
# SphereColliderPair
Component: GameObject
| The component creates a Sphere Collider Pair, much like the [ClothSphereColliderPair](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Cloth-sphereColliders.html/ClothSphereColliderPair). We use this as a simple way to retrieve information from the two Sphere Colliders in one call and send the information to the GPU. | ![https://i.imgur.com/oHwPDE4.png](https://i.imgur.com/oHwPDE4.png) |
| -------- | -------- |
## SphereA
SphereCollider: Default None.
+ The First Sphere Collider in the pair.
## SphereB
SphereCollider: Default None.
+ The second Sphere Collider in the pair.
## Friction
Float: Min 0, Max 1, Default 0.8.
+ Low Friction (e.g., 0.1): The cloth will slide more easily over the surface. It will maintain more of its velocity when colliding with the collider.
+ High Friction (e.g., 0.9): The cloth will "stick" more to the surface. It will lose more of its velocity when colliding with the collider.
+ High Friction (e.g., 1.0): The cloth will behave as if it's "stuck" to the surface, maintaining its position relative to the collider.
## Gizmo Color
Color: Default Green.
+ Changes the color of the outliner for the SphereColliderPair Collider.
------
# API
## GetCollidableSpherePairStruct()
Returns the following Struct:
```csharp
public struct CollidableSpherePairStruct {
public Vector3 centerA;
public float radiusA;
public Vector3 centerB;
public float radiusB;
public float friction;
}
```