Public Member Functions | |
void | PerformSimulationLoop () |
Public Attributes | |
Vector3[] | spherePositions |
The position at the current frame of each sphere. More... | |
Vector3[] | sphereVelocities |
The velocity of the current frame of each sphere. Initalized with zero entries. More... | |
float[] | sphereInverseMasses |
Vector3[] | sphereExternalForces |
The sum of all current external forces that are applied per particle/ sphere. More... | |
Vector3[] | cylinderPositions |
The center of mass of each cylinder. More... | |
float[] | cylinderScalarWeights |
Vector3[] | cylinderExternalTorques |
The sum of all current external torques that are applied per orientation element/ cylinder. More... | |
Vector3[][] | directors |
bool | solveStretchConstraints = true |
Whether or not to perform the constraint solving of the stretch constraint. More... | |
bool | solveBendTwistConstraints = true |
Whether or not to perform the constraint solving of the bend twist constraint. More... | |
Properties | |
int | ConstraintSolverSteps = 100 [get, set] |
bool | ExecuteSingleLoopTest = false [get, set] |
int | SpheresCount [get, private set] |
The count of all spheres of the guidewire. More... | |
int | CylinderCount [get, private set] |
The count of all cylinders of the guidewire. More... | |
Private Member Functions | |
void | Awake () |
void | Start () |
void | FixedUpdate () |
void | PerformInitializationStep () |
void | PerformPredictionStep () |
void | PerformConstraintSolvingStep () |
void | PerformUpdateStep () |
void | AdoptCalculations () |
Private Attributes | |
InitializationStep | initializationStep |
The component InitializationStep that is responsible for initializing the simulation. More... | |
PredictionStep | predictionStep |
The component PredictionStep that is responsible for executing the Prediction Step of the algorithm. More... | |
ConstraintSolvingStep | constraintSolvingStep |
UpdateStep | updateStep |
The component UpdateStep that is responsible for executing the Update Step of the algorithm. More... | |
ObjectSetter | objectSetter |
The component ObjectSetter that is responsible for setting all positions and rotations the the GameObjects. More... | |
MathHelper | mathHelper |
The component MathHelper that provides math related helper functions. More... | |
GameObject[] | spheres |
GameObject[] | cylinders |
Vector3[] | spherePositionPredictions |
The prediction of the position at the current frame of each sphere. More... | |
BSM.Quaternion[] | cylinderOrientations |
The orientation of each cylinder at its center of mass. More... | |
BSM.Quaternion[] | cylinderOrientationPredictions |
The prediction of the orientation of each cylinder at its center of mass. More... | |
Vector3[] | discreteRestDarbouxVectors |
Vector3[] | cylinderAngularVelocities |
float[,] | inertiaTensor |
The inertia tensor. Entries are approximates as in the CoRdE paper. More... | |
float[,] | inverseInertiaTensor |
The inverse of inertiaTensor. More... | |
BSM.Quaternion[] | worldSpaceBasis |
float | rodElementLength = 10f |
This class executes the outer simuluation loop of the algorithm and calls the implementations of each algorithm step and manages all coherent data.
|
private |
Adopts the data to the Unity GameObjects. For example, sets the positions of the GameObjects spheres to spherePositions.
Sets the positions of the GameObjects spheres to spherePositions.
Calculates cylinderPositions based on spherePositions.
Sets the positions of the GameObjects cylinders to cylinderPositions.
Sets the rotations of the GameObjects cylinders to cylinderOrientations.
|
private |
|
private |
|
private |
Performs the constraint solving step of the algorithm.
Performs the constraint solving of every constraint #solverStep many times.
Solve stretch constraints, if and only if solveStretchConstraints is true.
Solve bend twist constraints, if and only if solveBendTwistConstraints is true.
If solveStretchConstraints, then SpheresCount is at least two.
If solveStretchConstraints, then CylinderCount is at least one.
If solveBendTwistConstraints, then SpheresCount is at least three.
If solveBendTwistConstraints, then CylinderCount is at least two.
If solveStretchConstraints, after the step is complete the deviation between the actual rod element length and the default (rest state) rodElementLength should be close to zero.
If solveStretchConstraints, after the step is complete the deviation of the stretch constraint to zero should be close to zero.
|
private |
Calls every step that is mandatory to declare and initialize all data.
Set SpheresCount to the length of spheres.
Set CylinderCount to the length of cylinders.
Call every init method of initializationStep.
|
private |
Performs the prediction step of the algorithm.
Predict the sphereVelocities.
Predict the spherePositionPredictions.
Predict the cylinderAngularVelocities.
Predict the cylinderOrientationPredictions.
void GuidewireSim.SimulationLoop.PerformSimulationLoop | ( | ) |
Performs the outer simulation loop of the algorithm.
|
private |
Performs the update step of the algorithm.
Upate sphereVelocities.
Upate spherePositions.
Upate cylinderAngularVelocities.
Upate cylinderOrientations.
Upate directors.
|
private |
|
private |
The component ConstraintSolvingStep that is responsible for correcting the predictions with the collision and model constraints.
|
private |
The angular velocity of the current frame of each orientation element/ cylinder. Initalized with zero entries.
Vector3 [] GuidewireSim.SimulationLoop.cylinderExternalTorques |
The sum of all current external torques that are applied per orientation element/ cylinder.
|
private |
The prediction of the orientation of each cylinder at its center of mass.
|
private |
The orientation of each cylinder at its center of mass.
Vector3 [] GuidewireSim.SimulationLoop.cylinderPositions |
The center of mass of each cylinder.
|
private |
All cylinders that are part of the guidewire.
float [] GuidewireSim.SimulationLoop.cylinderScalarWeights |
The constant scalar weights of each orientation/ quaternion similar to sphereInverseMasses.
Vector3 [][] GuidewireSim.SimulationLoop.directors |
The orthonormal basis of each orientation element / cylinder, also called directors.
|
private |
The discrete Darboux Vector at the rest configuration, i.e. at frame 0.
|
private |
The inertia tensor. Entries are approximates as in the CoRdE paper.
|
private |
The component InitializationStep that is responsible for initializing the simulation.
|
private |
The inverse of inertiaTensor.
|
private |
The component MathHelper that provides math related helper functions.
|
private |
The component ObjectSetter that is responsible for setting all positions and rotations the the GameObjects.
|
private |
The component PredictionStep that is responsible for executing the Prediction Step of the algorithm.
|
private |
The distance between two spheres, also the distance between two orientations. Also the length of one cylinder.
bool GuidewireSim.SimulationLoop.solveBendTwistConstraints = true |
Whether or not to perform the constraint solving of the bend twist constraint.
bool GuidewireSim.SimulationLoop.solveStretchConstraints = true |
Whether or not to perform the constraint solving of the stretch constraint.
Vector3 [] GuidewireSim.SimulationLoop.sphereExternalForces |
The sum of all current external forces that are applied per particle/ sphere.
float [] GuidewireSim.SimulationLoop.sphereInverseMasses |
The constant inverse masses of each sphere.
|
private |
The prediction of the position at the current frame of each sphere.
Vector3 [] GuidewireSim.SimulationLoop.spherePositions |
The position at the current frame of each sphere.
|
private |
All spheres that are part of the guidewire.
Vector3 [] GuidewireSim.SimulationLoop.sphereVelocities |
The velocity of the current frame of each sphere. Initalized with zero entries.
|
private |
The component UpdateStep that is responsible for executing the Update Step of the algorithm.
|
private |
The three basis vectors of the world coordinate system as embedded quaternions with scalar part 0. E.g. the first basis vector is (1, 0, 0), the second (0, 1, 0) and the third (0, 0, 1).
|
getset |
How often the constraint solver iterates over each constraint during the Constraint Solving Step.
|
getprivate set |
The count of all cylinders of the guidewire.
|
getset |
Whether or not to execute the Single Loop Test, in which the outer simulation loop is exactly executed once.
|
getprivate set |
The count of all spheres of the guidewire.