Class SimplexSolver
A simplex solver.
Inherited Members
Namespace: Unity.Physics
Assembly: Unity.Physics.dll
Syntax
public static class SimplexSolver
Methods
ExamineActivePlanes(float3, SurfaceConstraintInfo*, ref int, ref float3)
Examine active planes.
Declaration
public static void ExamineActivePlanes(float3 up, SurfaceConstraintInfo* supportPlanes, ref int numSupportPlanes, ref float3 velocity)
Parameters
Type | Name | Description |
---|---|---|
float3 | up | The up vector. |
SurfaceConstraintInfo* | supportPlanes | The support planes. |
int | numSupportPlanes | [in,out] Number of support planes. |
float3 | velocity | [in,out] The velocity. |
Solve(float, float, float3, float, NativeList<SurfaceConstraintInfo>, ref float3, ref float3, out float, bool)
Solves.
Declaration
public static void Solve(float deltaTime, float minDeltaTime, float3 up, float maxVelocity, NativeList<SurfaceConstraintInfo> constraints, ref float3 position, ref float3 velocity, out float integratedTime, bool useConstraintVelocities = true)
Parameters
Type | Name | Description |
---|---|---|
float | deltaTime | The delta time. |
float | minDeltaTime | The minimum time delta time. |
float3 | up | The up vector. |
float | maxVelocity | The maximum velocity. |
NativeList<SurfaceConstraintInfo> | constraints | The constraints. |
float3 | position | [in,out] The position. |
float3 | velocity | [in,out] The velocity. |
float | integratedTime | [out] The integrated time. |
bool | useConstraintVelocities | (Optional) True to use constraint velocities. |
Solve1d(SurfaceConstraintInfo, ref float3)
Solve 1d.
Declaration
public static void Solve1d(SurfaceConstraintInfo constraint, ref float3 velocity)
Parameters
Type | Name | Description |
---|---|---|
SurfaceConstraintInfo | constraint | The constraint. |
float3 | velocity | [in,out] The velocity. |
Solve2d(float3, SurfaceConstraintInfo, SurfaceConstraintInfo, ref float3)
Solve 2D.
Declaration
public static void Solve2d(float3 up, SurfaceConstraintInfo constraint0, SurfaceConstraintInfo constraint1, ref float3 velocity)
Parameters
Type | Name | Description |
---|---|---|
float3 | up | The up vector. |
SurfaceConstraintInfo | constraint0 | The first constraint. |
SurfaceConstraintInfo | constraint1 | The second constraint. |
float3 | velocity | [in,out] The velocity. |
Solve3d(float3, SurfaceConstraintInfo, SurfaceConstraintInfo, SurfaceConstraintInfo, ref float3)
Solve 3D.
Declaration
public static void Solve3d(float3 up, SurfaceConstraintInfo constraint0, SurfaceConstraintInfo constraint1, SurfaceConstraintInfo constraint2, ref float3 velocity)
Parameters
Type | Name | Description |
---|---|---|
float3 | up | The up vector. |
SurfaceConstraintInfo | constraint0 | The first constraint. |
SurfaceConstraintInfo | constraint1 | The second constraint. |
SurfaceConstraintInfo | constraint2 | The third constraint. |
float3 | velocity | [in,out] The velocity. |
Sort2d(ref SurfaceConstraintInfo, ref SurfaceConstraintInfo)
Sort 2D.
Declaration
public static void Sort2d(ref SurfaceConstraintInfo plane0, ref SurfaceConstraintInfo plane1)
Parameters
Type | Name | Description |
---|---|---|
SurfaceConstraintInfo | plane0 | The first plane. |
SurfaceConstraintInfo | plane1 | The second plane. |
Sort3d(ref SurfaceConstraintInfo, ref SurfaceConstraintInfo, ref SurfaceConstraintInfo)
Sort 3D.
Declaration
public static void Sort3d(ref SurfaceConstraintInfo plane0, ref SurfaceConstraintInfo plane1, ref SurfaceConstraintInfo plane2)
Parameters
Type | Name | Description |
---|---|---|
SurfaceConstraintInfo | plane0 | The first plane. |
SurfaceConstraintInfo | plane1 | The second plane. |
SurfaceConstraintInfo | plane2 | The third plane. |
SwapPlanes(ref SurfaceConstraintInfo, ref SurfaceConstraintInfo)
Swap planes.
Declaration
public static void SwapPlanes(ref SurfaceConstraintInfo plane0, ref SurfaceConstraintInfo plane1)
Parameters
Type | Name | Description |
---|---|---|
SurfaceConstraintInfo | plane0 | The first plane. |
SurfaceConstraintInfo | plane1 | The second plane. |
Test1d(SurfaceConstraintInfo, float3)
Tests 1d.
Declaration
public static bool Test1d(SurfaceConstraintInfo constraint, float3 velocity)
Parameters
Type | Name | Description |
---|---|---|
SurfaceConstraintInfo | constraint | The constraint. |
float3 | velocity | The velocity. |
Returns
Type | Description |
---|---|
bool | True if the test passes, false if the test fails. |