Public Member Functions | |
void | InitSpherePositions (GameObject[] spheres, int spheresCount, out Vector3[] spherePositions) |
void | InitSphereVelocities (int spheresCount, out Vector3[] sphereVelocities) |
void | InitSphereInverseMasses (int spheresCount, out float[] sphereInverseMasses) |
void | InitCylinderPositions (int cylinderCount, Vector3[] spherePositions, out Vector3[] cylinderPositions) |
void | InitCylinderOrientations (int cylinderCount, out BSM.Quaternion[] cylinderOrientations) |
void | InitDiscreteRestDarbouxVectors (int cylinderCount, BSM.Quaternion[] cylinderOrientations, out Vector3[] discreteRestDarbouxVectors, float rodElementLength) |
void | InitCylinderAngularVelocities (int cylinderCount, out Vector3[] cylinderAngularVelocities) |
void | InitCylinderScalarWeights (int cylinderCount, out float[] cylinderScalarWeights) |
void | InitSphereExternalForces (int spheresCount, out Vector3[] sphereExternalForces) |
void | InitSpherePositionPredictions (int spheresCount, out Vector3[] spherePositionPredictions) |
void | InitCylinderOrientationPredictions (int cylinderCount, out BSM.Quaternion[] cylinderOrientationPredictions) |
void | InitInertiaTensor (out float[,] inertiaTensor) |
void | InitInverseInertiaTensor (float[,] inertiaTensor, out float[,] inverseInertiaTensor) |
void | InitCylinderExternalTorques (int cylinderCount, out Vector3[] cylinderExternalTorques) |
void | InitWorldSpaceBasis (out BSM.Quaternion[] worldSpaceBasis) |
void | InitDirectors (int cylinderCount, BSM.Quaternion[] worldSpaceBasis, out Vector3[][] directors) |
Private Member Functions | |
void | Awake () |
Private Attributes | |
MathHelper | mathHelper |
The component MathHelper that provides math related helper functions. More... | |
float | materialDensity = 7860 |
float | materialRadius = 0.001f |
This class is responsible for initializing all data with their initial values of the simulation at the start of the simulation.
|
private |
void GuidewireSim.InitializationStep.InitCylinderAngularVelocities | ( | int | cylinderCount, |
out Vector3[] | cylinderAngularVelocities | ||
) |
Initializes cylinderAngularVelocities
with the default value of zero at the start of the simulation.
cylinderCount | The count of all cylinders of the guidewire. Equals the length of cylinderOrientationPredictions . | |
[out] | cylinderAngularVelocities | The angular velocity of the current frame of each orientation element/ cylinder. |
void GuidewireSim.InitializationStep.InitCylinderExternalTorques | ( | int | cylinderCount, |
out Vector3[] | cylinderExternalTorques | ||
) |
Initializes cylinderExternalTorques
with the default value of zero at the start of the simulation.
cylinderCount | The count of all cylinders of the guidewire. Equals the length of cylinderOrientationPredictions . | |
[out] | cylinderExternalTorques | The sum of all current external torques that are applied per orientation element/ cylinder. |
void GuidewireSim.InitializationStep.InitCylinderOrientationPredictions | ( | int | cylinderCount, |
out BSM.Quaternion[] | cylinderOrientationPredictions | ||
) |
Initializes cylinderOrientationPredictions
with the default value of (0f, 0f, 0f, 1f) which equals the quaternion identity at the start of the simulation.
cylinderCount | The count of all cylinders of the guidewire. Equals the length of cylinderOrientationPredictions . | |
[out] | cylinderOrientationPredictions | The prediction of the orientation of each cylinder at its center of mass. |
void GuidewireSim.InitializationStep.InitCylinderOrientations | ( | int | cylinderCount, |
out BSM.Quaternion[] | cylinderOrientations | ||
) |
Initializes cylinderOrientations
with the default value of (0f, 0f, 0f, 1f) which equals the quaternion identity at the start of the simulation.
cylinderCount | The count of all cylinders of the guidewire. Equals the length of cylinderOrientations . | |
[out] | cylinderOrientations | The orientation of each cylinder at its center of mass. |
void GuidewireSim.InitializationStep.InitCylinderPositions | ( | int | cylinderCount, |
Vector3[] | spherePositions, | ||
out Vector3[] | cylinderPositions | ||
) |
Initializes cylinderPositions
as middle points of the positions of spheres
at the start of the simulation.
spheresCount | The count of all spheres of the guidewire. Equals the length of spherePositionPredictions . | |
cylinderCount | The count of all cylinders of the guidewire. Equals the length of cylinderOrientationPredictions . | |
[out] | cylinderPositions | The position/ center of mass of each cylinder. |
void GuidewireSim.InitializationStep.InitCylinderScalarWeights | ( | int | cylinderCount, |
out float[] | cylinderScalarWeights | ||
) |
Initializes cylinderScalarWeights
with the default value of one at the start of the simulation.
cylinderCount | The count of all cylinders of the guidewire. Equals the length of cylinderOrientationPredictions . | |
[out] | cylinderScalarWeights | The constant scalar weights of each orientation/ quaternion similar to sphereInverseMasses . |
void GuidewireSim.InitializationStep.InitDirectors | ( | int | cylinderCount, |
BSM.Quaternion[] | worldSpaceBasis, | ||
out Vector3 | directors[][] | ||
) |
Initializes the directors
array of arrays. The zero-th array defines all first directors of each director basis and so on.
cylinderCount | The count of all cylinders of the guidewire. Equals the length of cylinderOrientationPredictions . | |
worldSpaceBasis | The three basis vectors of the world coordinate system. | |
[out] | directors | The orthonormal basis of each orientation element / cylinder, also called directors. |
void GuidewireSim.InitializationStep.InitDiscreteRestDarbouxVectors | ( | int | cylinderCount, |
BSM.Quaternion[] | cylinderOrientations, | ||
out Vector3[] | discreteRestDarbouxVectors, | ||
float | rodElementLength | ||
) |
Calculates the discrete darboux vector for each orientation pair (two adjacent orientations) at its rest configuration, i.e. at frame 0.
cylinderCount | The count of all cylinders of the guidewire. Equals the length of cylinderOrientationPredictions . | |
cylinderOrientations | The orientation of each cylinder at its center of mass. | |
[out] | 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.InitializationStep.InitInertiaTensor | ( | out float | inertiaTensor[,] | ) |
Initializes inertiaTensor
so that all elements except the diagonal ones are zero. The first and second diagonal entry equal \( \rho * \pi * \frac{r^{2}}{4} \), and the third diagonal entry equals \( \rho * \pi * \frac{r^{2}}{2} \).
[out] | inertiaTensor | The inertia tensor. Entries are approximates as in the CoRdE paper. |
void GuidewireSim.InitializationStep.InitInverseInertiaTensor | ( | float | inertiaTensor[,], |
out float | inverseInertiaTensor[,] | ||
) |
Initializes inverseInertiaTensor
as the inverse of inertiaTensor
.
inertiaTensor | The inertia tensor. Entries are approximates as in the CoRdE paper. | |
[out] | inverseInertiaTensor | The inverse of inertiaTensor . |
void GuidewireSim.InitializationStep.InitSphereExternalForces | ( | int | spheresCount, |
out Vector3[] | sphereExternalForces | ||
) |
Initializes sphereExternalForces
with the default value of zero at the start of the simulation.
spheresCount | The count of all spheres of the guidewire. Equals the length of spherePositionPredictions . | |
[out] | sphereExternalForces | The sum of all current external forces that are applied per particle/ sphere. |
void GuidewireSim.InitializationStep.InitSphereInverseMasses | ( | int | spheresCount, |
out float[] | sphereInverseMasses | ||
) |
Initializes sphereInverseMasses
with the default value of one at the start of the simulation.
spheresCount | The count of all spheres of the guidewire. Equals the length of spherePositionPredictions . | |
[out] | sphereInverseMasses | The constant inverse masses of each sphere. |
void GuidewireSim.InitializationStep.InitSpherePositionPredictions | ( | int | spheresCount, |
out Vector3[] | spherePositionPredictions | ||
) |
Initializes spherePositionPredictions
with the default value of zero at the start of the simulation.
spheresCount | The count of all spheres of the guidewire. Equals the length of spherePositionPredictions . | |
[out] | spherePositionPredictions | The prediction of the position at the current frame of each sphere. |
void GuidewireSim.InitializationStep.InitSpherePositions | ( | GameObject[] | spheres, |
int | spheresCount, | ||
out Vector3[] | spherePositions | ||
) |
Initializes spherePositions
with the positions of spheres
at the start of the simulation.
spheres | All spheres that are part of the guidewire. | |
spheresCount | The count of all spheres of the guidewire. Equals the length of spherePositionPredictions . | |
[out] | spherePositions | The position at the current frame of each sphere. |
spheresCount
should be at least one. void GuidewireSim.InitializationStep.InitSphereVelocities | ( | int | spheresCount, |
out Vector3[] | sphereVelocities | ||
) |
Initializes sphereVelocities
with the default value of zero at the start of the simulation.
spheresCount | The count of all spheres of the guidewire. Equals the length of spherePositionPredictions . | |
[out] | sphereVelocities | The velocity of the current frame of each sphere. |
void GuidewireSim.InitializationStep.InitWorldSpaceBasis | ( | out BSM.Quaternion[] | worldSpaceBasis | ) |
Initializes the world space basis vectors (1, 0, 0), (0, 1, 0), (0, 0, 1) as embedded quaternions with scalar part zero.
[out] | worldSpaceBasis | The three basis vectors of the world coordinate system. |
|
private |
The density of the rod material. The value 7960 is taken from Table 2 of the CoRdE paper.
|
private |
The radius of the cross-section of the rod. Tha value 0.001 or 1mm is taken from Table 2 of the CoRdE paper.
|
private |
The component MathHelper that provides math related helper functions.