Public Member Functions | |
void | SolveStretchConstraints (Vector3[] spherePositionPredictions, BSM.Quaternion[] cylinderOrientationPredictions, int spheresCount, BSM.Quaternion[] worldSpaceBasis, float rodElementLength) |
void | SolveBendTwistConstraints (BSM.Quaternion[] cylinderOrientationPredictions, int cylinderCount, Vector3[] discreteRestDarbouxVectors, float rodElementLength) |
void | SolveStretchConstraint (Vector3 particlePositionOne, Vector3 particlePositionTwo, BSM.Quaternion orientation, BSM.Quaternion e_3, float rodElementLength, out Vector3 deltaPositionOne, out Vector3 deltaPositionTwo, out BSM.Quaternion deltaOrientation, float inverseMassOne=1f, float inverseMassTwo=1f, float inertiaWeight=1f) |
void | SolveBendTwistConstraint (BSM.Quaternion orientationOne, BSM.Quaternion orientationTwo, Vector3 discreteRestDarbouxVector, float rodElementLength, out BSM.Quaternion deltaOrientationOne, out BSM.Quaternion deltaOrientationTwo, float inertiaWeightOne=1f, float inertiaWeightTwo=1f) |
Private Member Functions | |
void | Awake () |
void | SolveStretchConstraintsInBilateralOrder (Vector3[] spherePositionPredictions, BSM.Quaternion[] cylinderOrientationPredictions, int spheresCount, float rodElementLength, BSM.Quaternion e_3) |
void | SolveStretchConstraintsInNaiveOrder (Vector3[] spherePositionPredictions, BSM.Quaternion[] cylinderOrientationPredictions, int spheresCount, float rodElementLength, BSM.Quaternion e_3) |
void | SolveBendTwistConstraintsInBilateralOrder (BSM.Quaternion[] cylinderOrientationPredictions, int cylinderCount, Vector3[] discreteRestDarbouxVectors, float rodElementLength) |
void | SolveBendTwistConstraintsInNaiveOrder (BSM.Quaternion[] cylinderOrientationPredictions, int cylinderCount, Vector3[] discreteRestDarbouxVectors, float rodElementLength) |
void | CorrectStretchPredictions (int sphereIndex, Vector3[] spherePositionPredictions, BSM.Quaternion[] cylinderOrientationPredictions) |
void | CorrectBendTwistPredictions (int cylinderIndex, BSM.Quaternion[] cylinderOrientationPredictions) |
Private Attributes | |
MathHelper | mathHelper |
The component MathHelper that provides math related helper functions. More... | |
Vector3 | deltaPositionOne = new Vector3() |
The correction of particlePositionOne in method SolveStretchConstraint(). More... | |
Vector3 | deltaPositionTwo = new Vector3() |
The correction of particlePositionTwo in method SolveStretchConstraint(). More... | |
BSM.Quaternion | deltaOrientation = new BSM.Quaternion() |
The correction of orientation in method SolveStretchConstraint(). More... | |
BSM.Quaternion | deltaOrientationOne = new BSM.Quaternion() |
The correction of orientationOne in method SolveBendTwistConstraint(). More... | |
BSM.Quaternion | deltaOrientationTwo = new BSM.Quaternion() |
The correction of orientationTwo in method SolveBendTwistConstraint(). More... | |
bool | executeInBilateralOrder = false |
Whether to solve both constraints in bilateral interleaving order. Naive order is used when false. More... | |
This class executes and implements various algorithms of the constraint solving step of the algorithm and manages all coherent data.
|
private |
|
private |
Corrects the predictions of the bend twist constraint by adding deltaOrientationOne
and deltaOrientationTwo
.
deltaOrientationOne
and deltaOrientationTwo
may have a length unequal one by definition. cylinderIndex | The index of the first element of cylinderOrientationPredictions that gets corrected. |
cylinderOrientationPredictions | The array of orientation predictions of which two quaternions get corrected in this method. |
The relevant entries of cylinderOrientationPredictions
should be unit quaternions, i.e. have length approximately equal to one.
After the quaternion predictions got corrected, they should again be unit quaternions, i.e. have length approximately equal to one.
|
private |
Corrects the predictions of the stretch constraint by adding deltaPositionOne
, deltaPositionTwo
and deltaOrientation
.
deltaOrientation
may has a length unequal one by definition. sphereIndex | The index of the first element of spherePositionPredictions that gets corrected. |
spherePositionPredictions | The array of position predictions of which two positions get corrected in this method. |
cylinderOrientationPredictions | The array of orientation predictions of which one quaternions gets corrected in this method. |
The relevant entries of cylinderOrientationPredictions
should be unit quaternions, i.e. have length approximately equal to one.
After the quaternion prediction got corrected, it should again be a unit quaternions, i.e. have length approximately equal to one.
void GuidewireSim.ConstraintSolvingStep.SolveBendTwistConstraint | ( | BSM.Quaternion | orientationOne, |
BSM.Quaternion | orientationTwo, | ||
Vector3 | discreteRestDarbouxVector, | ||
float | rodElementLength, | ||
out BSM.Quaternion | deltaOrientationOne, | ||
out BSM.Quaternion | deltaOrientationTwo, | ||
float | inertiaWeightOne = 1f , |
||
float | inertiaWeightTwo = 1f |
||
) |
Solves the bend twist constraint by calculating the corrections deltaOrientationOne
and deltaOrientationTwo
.
orientationOne | The first orientation quaternion prediction of the orientation element to be corrected. | |
orientationTwo | The second orientation quaternion prediction of the orientation element to be corrected. | |
discreteRestDarbouxVector | The discrete Darboux Vector at the rest configuration, i.e. at frame 0. | |
rodElementLength | The distance between two spheres, also the distance between two orientations. | |
[out] | deltaOrientationOne | The correction of orientationOne . |
[out] | deltaOrientationTwo | The correction of orientationTwo . |
inertiaWeightOne | The inertia weight scalar for orientationOne . Use a value of 1 for a moving orientation and 0 for a fixed orientation. | |
inertiaWeightTwo | The inertia weight scalar for orientationTwo . Use a value of 1 for a moving orientation and 0 for a fixed orientation. |
orientationOne
and orientationTwo
should be unit quaternions, i.e. have length approximately equal to one.
rodElementLength
should be positive.
inertiaWeightOne
and inertiaWeightTwo
should be values between 0 and 1.
void GuidewireSim.ConstraintSolvingStep.SolveBendTwistConstraints | ( | BSM.Quaternion[] | cylinderOrientationPredictions, |
int | cylinderCount, | ||
Vector3[] | discreteRestDarbouxVectors, | ||
float | rodElementLength | ||
) |
Is responsible for executing one iteration of the constraint solving step for the bend twist constraint, i.e. corrects each orientation prediction one time.
cylinderOrientationPredictions | The array of orientation predictions that get corrected in this step. |
cylinderCount | The count of all cylinders of the guidewire. Equals the length of cylinderOrientationPredictions . |
discreteRestDarbouxVectors | The array of all discrete Darboux Vectors at the rest configuration, i.e. at frame 0. Has (n-1) elements, if n is the number of orientations of the guidewire, because the darboux vector is taken of two adjacent orientations. |
rodElementLength | The distance between two spheres, also the distance between two orientations. |
cylinderCount
should be at least one.
rodElementLength
should be positive.
Executes the constraint solving step in bilateral interleaving order if executeInBilateralOrder and otherwise in naive order.
|
private |
Is responsible for executing one iteration of the constraint solving step for the bend twist constraint in bilateral order, i.e. corrects each orientation prediction one time.
cylinderOrientationPredictions | The array of orientation predictions that get corrected in this step. |
cylinderCount | The count of all cylinders of the guidewire. Equals the length of cylinderOrientationPredictions . |
discreteRestDarbouxVectors | The array of all discrete Darboux Vectors at the rest configuration, i.e. at frame 0. Has (n-1) elements, if n is the number of orientations of the guidewire, because the darboux vector is taken of two adjacent orientations. |
rodElementLength | The distance between two spheres, also the distance between two orientations. |
cylinderCount
should be at least one.
rodElementLength
should be positive.
|
private |
Is responsible for executing one iteration of the constraint solving step for the bend twist constraint in naive order, i.e. corrects each orientation prediction one time.
cylinderOrientationPredictions | The array of orientation predictions that get corrected in this step. |
cylinderCount | The count of all cylinders of the guidewire. Equals the length of cylinderOrientationPredictions . |
discreteRestDarbouxVectors | The array of all discrete Darboux Vectors at the rest configuration, i.e. at frame 0. Has (n-1) elements, if n is the number of orientations of the guidewire, because the darboux vector is taken of two adjacent orientations. |
rodElementLength | The distance between two spheres, also the distance between two orientations. |
cylinderCount
should be at least one.
rodElementLength
should be positive.
void GuidewireSim.ConstraintSolvingStep.SolveStretchConstraint | ( | Vector3 | particlePositionOne, |
Vector3 | particlePositionTwo, | ||
BSM.Quaternion | orientation, | ||
BSM.Quaternion | e_3, | ||
float | rodElementLength, | ||
out Vector3 | deltaPositionOne, | ||
out Vector3 | deltaPositionTwo, | ||
out BSM.Quaternion | deltaOrientation, | ||
float | inverseMassOne = 1f , |
||
float | inverseMassTwo = 1f , |
||
float | inertiaWeight = 1f |
||
) |
Solves the stretch constraint by calculating the corrections deltaPositionOne
and deltaPositionTwo
, deltaOrientation
.
particlePositionOne | The first particle position prediction of the centerline element to be corrected. | |
particlePositionTwo | The second particle position prediction of the centerline element to be corrected. | |
orientation | The orientation quaternion prediction of the orientation element between the particle positions to be corrected. | |
e_3 | The third basis vector of the world space coordinates embedded as a quaternion with scalar part 0. | |
rodElementLength | The distance between two spheres, also the distance between two orientations. | |
[out] | deltaPositionOne | The correction of particlePositionOne . |
[out] | deltaPositionTwo | The correction of particlePositionTwo . |
[out] | deltaOrientation | The correction of orientation . |
inverseMassOne | The inverse mass scalar for particlePositionOne . Use a value of 1 for a moving particle and 0 for a fixed particle. | |
inverseMassTwo | The inverse mass scalar for particlePositionTwo . Use a value of 1 for a moving particle and 0 for a fixed particle. | |
inertiaWeight | The inertia weight scalar for orientation . Use a value of 1 for a moving orientation and 0 for a fixed orientation. |
orientation
should be a unit quaternions, i.e. have length approximately equal to one.
e_3
should be a unit quaternions, i.e. have length approximately equal to one.
rodElementLength
should be positive.
inverseMassOne
, inverseMassTwo
and inertiaWeight
should be values between 0 and 1.
void GuidewireSim.ConstraintSolvingStep.SolveStretchConstraints | ( | Vector3[] | spherePositionPredictions, |
BSM.Quaternion[] | cylinderOrientationPredictions, | ||
int | spheresCount, | ||
BSM.Quaternion[] | worldSpaceBasis, | ||
float | rodElementLength | ||
) |
Is responsible for executing one iteration of the constraint solving step for the stretch constraint, i.e. corrects each particle position prediction one time and also each orientation prediction one time.
spherePositionPredictions | The array of position predictions that get corrected in this step. |
cylinderOrientationPredictions | The array of orientation predictions that get corrected in this step. |
spheresCount | The count of all spheres of the guidewire. Equals the length of spherePositionPredictions . |
worldSpaceBasis | The three basis vectors of the world coordinate system as embedded quaternions with scalar part 0. |
rodElementLength | The distance between two spheres, also the distance between two orientations. |
spheresCount
should be at least one.
rodElementLength
should be positive.
Executes the constraint solving step in bilateral interleaving order if executeInBilateralOrder and otherwise in naive order.
|
private |
Executes one iteration of the constraint solving step for the stretch constraint in bilateral order, i.e. corrects each particle position prediction one time and also each orientation prediction one time.
spherePositionPredictions | The array of position predictions that get corrected in this step. |
cylinderOrientationPredictions | The array of orientation predictions that get corrected in this step. |
spheresCount | The count of all spheres of the guidewire. Equals the length of spherePositionPredictions . |
rodElementLength | The distance between two spheres, also the distance between two orientations. |
e_3 | The third basis vector of the world coordinate system as embedded quaternions with scalar part 0. |
spheresCount
should be at least one.
rodElementLength
should be positive.
|
private |
Executes one iteration of the constraint solving step for the stretch constraint in naive order, i.e. corrects each particle position prediction one time and also each orientation prediction one time.
spherePositionPredictions | The array of position predictions that get corrected in this step. |
cylinderOrientationPredictions | The array of orientation predictions that get corrected in this step. |
spheresCount | The count of all spheres of the guidewire. Equals the length of spherePositionPredictions . |
rodElementLength | The distance between two spheres, also the distance between two orientations. |
e_3 | The third basis vector of the world coordinate system as embedded quaternions with scalar part 0. |
spheresCount
should be at least one.
rodElementLength
should be positive.
|
private |
The correction of orientation
in method SolveStretchConstraint().
|
private |
The correction of orientationOne
in method SolveBendTwistConstraint().
|
private |
The correction of orientationTwo
in method SolveBendTwistConstraint().
|
private |
The correction of particlePositionOne
in method SolveStretchConstraint().
|
private |
The correction of particlePositionTwo
in method SolveStretchConstraint().
|
private |
Whether to solve both constraints in bilateral interleaving order. Naive order is used when false.
|
private |
The component MathHelper that provides math related helper functions.