Class SimplexSolver
A simplex solver.
Inherited Members
Namespace: Unity.Physics
Syntax
public static class SimplexSolver
Methods
ExamineActivePlanes(float3, SurfaceConstraintInfo*, ref Int32, 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. |
Int32 | numSupportPlanes | [in,out] Number of support planes. |
float3 | velocity | [in,out] The velocity. |
Solve(Single, Single, float3, Single, NativeList<SurfaceConstraintInfo>, ref float3, ref float3, out Single, Boolean)
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 |
---|---|---|
Single | deltaTime | The delta time. |
Single | minDeltaTime | The minimum time delta time. |
float3 | up | The up vector. |
Single | maxVelocity | The maximum velocity. |
NativeList<SurfaceConstraintInfo> | constraints | The constraints. |
float3 | position | [in,out] The position. |
float3 | velocity | [in,out] The velocity. |
Single | integratedTime | [out] The integrated time. |
Boolean | 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 |
---|---|
Boolean | True if the test passes, false if the test fails. |