GuidewireSim.UnitTest_SolveStretchConstraint Class Reference
Inheritance diagram for GuidewireSim.UnitTest_SolveStretchConstraint:

## Private Member Functions

void | Awake ()
void | Start ()
void | PerformUnitTests ()
void | PickRandomPositions (out Vector3 particlePositionOne, out Vector3 particlePositionTwo)
void | Test_SolveStretchConstraint (int iterations, Vector3 particlePositionOne, Vector3 particlePositionTwo, BSM.Quaternion orientation, bool logDeltaResults=false)
void | CheckStretchConstraintDeviation (Vector3 particlePositionOne, Vector3 particlePositionTwo, BSM.Quaternion orientation, BSM.Quaternion e_3, float rodElementLength)
void | CheckRodElementLength (Vector3 particlePositionOne, Vector3 particlePositionTwo, float defaultRodElementLength)

## Static Private Member Functions

static void | LogDeltaResults (in Vector3 deltaPositionOne, in Vector3 deltaPositionTwo, in BSM.Quaternion deltaOrientation)

## Private Attributes

MathHelper | mathHelper
| The component MathHelper that provides math related helper functions. More...
ConstraintSolvingStep | constraintSolvingStep
bool | executeUnitTest = false
| Whether or not to perform all unit tests of this script. More...
int | sampleSize = 10
float | rodElementLength = 10f

## Member Function Documentation

## Awake()

void GuidewireSim.UnitTest_SolveStretchConstraint.Awake | ( |  | ) |

private

## CheckRodElementLength()

void GuidewireSim.UnitTest_SolveStretchConstraint.CheckRodElementLength | ( | Vector3 | particlePositionOne,
|  | Vector3 | particlePositionTwo,
|  | float | defaultRodElementLength
| ) |  |

private

## CheckStretchConstraintDeviation()

void GuidewireSim.UnitTest_SolveStretchConstraint.CheckStretchConstraintDeviation | ( | Vector3 | particlePositionOne,
|  | Vector3 | particlePositionTwo,
|  | BSM.Quaternion | orientation,
|  | BSM.Quaternion | e_3,
|  | float | rodElementLength
| ) |  |

private

## LogDeltaResults()

static void GuidewireSim.UnitTest_SolveStretchConstraint.LogDeltaResults | ( | in Vector3 | deltaPositionOne,
|  | in Vector3 | deltaPositionTwo,
|  | in BSM.Quaternion | deltaOrientation
| ) |  |

staticprivate

## PerformUnitTests()

void GuidewireSim.UnitTest_SolveStretchConstraint.PerformUnitTests | ( |  | ) |

private

## PickRandomPositions()

void GuidewireSim.UnitTest_SolveStretchConstraint.PickRandomPositions | ( | out Vector3 | particlePositionOne,
|  | out Vector3 | particlePositionTwo
| ) |  |

private

Picks the first particle position uniformly distributed with \( x,y,z \in [-5, 5] \) and the second uniformly distributed around the first position with a uniformly distributed distance in \( [rodElementLength - maximalDistanceOffset, rodElementLength + maximalDistanceOffset] \).

Note
  The method for picking the second position is inspired by https://math.stackexchange.com/q/50482

Requirements:

  Picks the first particle position uniformly distributed so that \( x,y,z \in [-5, 5] \).

  Picks a distance between the two particles that is uniformly distributed in the interval \( [rodElementLength - maximalDistanceOffset, rodElementLength + maximalDistanceOffset] \).

  Picks the second particle position uniformly distributed on the surface of the sphere with center `particlePositionOne` and radius `startDistance`.

## Start()

void GuidewireSim.UnitTest_SolveStretchConstraint.Start | ( |  | ) |

private

## Test_SolveStretchConstraint()

void GuidewireSim.UnitTest_SolveStretchConstraint.Test_SolveStretchConstraint | ( | int | iterations,
|  | Vector3 | particlePositionOne,
|  | Vector3 | particlePositionTwo,
|  | BSM.Quaternion | orientation,
|  | bool | logDeltaResults = `false`
| ) |  |

private

## Member Data Documentation

## constraintSolvingStep

ConstraintSolvingStep GuidewireSim.UnitTest_SolveStretchConstraint.constraintSolvingStep

private

The component ConstraintSolvingStep that is responsible for correcting the predictions with the collision and model constraints.

## executeUnitTest

bool GuidewireSim.UnitTest_SolveStretchConstraint.executeUnitTest = false

private

Whether or not to perform all unit tests of this script.

## mathHelper

MathHelper GuidewireSim.UnitTest_SolveStretchConstraint.mathHelper

private

The component MathHelper that provides math related helper functions.

## rodElementLength

float GuidewireSim.UnitTest_SolveStretchConstraint.rodElementLength = 10f

private

## sampleSize

int GuidewireSim.UnitTest_SolveStretchConstraint.sampleSize = 10

private

The number of value-pairs the test is executed with. E.g. if sampleSize is 10, then the unit test is executed with 10 randomly drawn value-pairs. A higher number needs more time to execute.

The documentation for this class was generated from the following file:

- UnitTest_SolveStretchConstraint.cs