Public Member Functions | |
void | SetSpherePositions (GameObject[] spheres, int spheresCount, Vector3[] spherePositions) |
void | SetCylinderPositions (GameObject[] cylinders, int cylinderCount, Vector3[] cylinderPositions) |
void | SetCylinderOrientations (GameObject[] cylinders, int cylinderCount, BSM.Quaternion[] cylinderOrientations, Vector3[][] directors) |
Private Member Functions | |
void | Awake () |
Private Attributes | |
MathHelper | mathHelper |
The component MathHelper that provides math related helper functions. More... | |
This class is responsible for setting the transformation positions of the GameObjects in the scene to their respective simulation data like spherePositions
.
|
private |
void GuidewireSim.ObjectSetter.SetCylinderOrientations | ( | GameObject[] | cylinders, |
int | cylinderCount, | ||
BSM.Quaternion[] | cylinderOrientations, | ||
Vector3 | directors[][] | ||
) |
Rotates each cylinder GameObject such that its centerline is parallel with the line segment that is spanned by the two adjacent sphere's center of masses.
cylinders | All cylinders that are part of the guidewire. |
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. |
directors | The orthonormal basis of each orientation element / cylinder, also called directors. |
appliedTransformation
is the rotation that aligns the y-axis of the cylinder with the z-axis of the orientations (the third director). This is needed, because the y-axis of the cylinder is parallel with its centerline, while the z-axis of the orientations (the third director) is also defined as being parallel with the cylinder's centerline. Thus appliedTransformation
is necessary. void GuidewireSim.ObjectSetter.SetCylinderPositions | ( | GameObject[] | cylinders, |
int | cylinderCount, | ||
Vector3[] | cylinderPositions | ||
) |
Sets the positions of the GameObjects cylinders
to their respective cylinderPositions
.
cylinders | All cylinders that are part of the guidewire. |
cylinderCount | The count of all cylinders of the guidewire. Equals the length of cylinderOrientationPredictions . |
cylinderPositions | The position/ center of mass of each cylinder. |
void GuidewireSim.ObjectSetter.SetSpherePositions | ( | GameObject[] | spheres, |
int | spheresCount, | ||
Vector3[] | spherePositions | ||
) |
Sets the positions of the GameObjects spheres
to their respective spherePositions
.
spheres | All spheres that are part of the guidewire. |
spheresCount | The count of all spheres of the guidewire. Equals the length of spherePositionPredictions . |
spherePositions | The position at the current frame of each sphere. |
|
private |
The component MathHelper that provides math related helper functions.