Public Member Functions | |
void | SolveCollisionConstraints (Vector3[] spherePositionPredictions, int solverStep, int constraintSolverSteps) |
Private Member Functions | |
void | Awake () |
void | SolveCollisionConstraint (Vector3 spherePositionPrediction, Vector3 contactPoint, Vector3 collisionNormal, int solverStep, out Vector3 deltaPosition) |
void | DrawCollisionInformation (Vector3 spherePositionPrediction, Vector3 contactPoint, Vector3 collisionNormal) |
Vector3 | CalculateDeltaPosition (Vector3 spherePositionPrediction, Vector3 closestSurfacePoint, Vector3 normalVector) |
void | CorrectCollisionPredictions (int sphereIndex, Vector3[] spherePositionPredictions, int solverStep, int constraintSolverSteps) |
Private Attributes | |
MathHelper | mathHelper |
The component MathHelper that provides math related helper functions. More... | |
CollisionHandler | collisionHandler |
The component CollisionHandler that tracks all collisions. More... | |
Vector3 | deltaPosition = new Vector3() |
The correction of spherePositionPrediction in method SolveCollisionConstraint(). More... | |
Vector3 | initialPositionPrediction = new Vector3() |
float | sphereRadius = 5f |
The radius of a sphere of the guidewire. More... | |
float | collisionMargin = 0.1f |
float | collisionStiffness = 0.001f |
The collision constraint stiffness parameter. More... | |
This class implements the collision solving that is part of the constraint solving step.
|
private |
|
private |
Calculates the displacement of the collision constraint.
spherePositionPredictions | The prediction of the position at the current frame of each sphere (in this case of the last frame). |
closestSurfacePoint | The contact point of the collision. |
normalVector | The collision normal. |
|
private |
Corrects the position prediction of the sphere of sphereIndex
with the calculated displacement.
sphereIndex | The sphere ID of the colliding sphere. |
spherePositionPredictions | The prediction of the position at the current frame of each sphere (in this case of the last frame). |
solverStep | The current iteration of the constraint solving step. |
constraintSolverSteps | The total number of solver steps of the constraint solving step. |
|
private |
Draws the contact point, collision normal, and displacement corrections into the scene of the collision that occured.
spherePositionPrediction | The position prediction of the sphere that collided. |
contactPoint | The contact point of the collision. |
collisionNormal | The normal of the collision. |
|
private |
Solves the collision constraint for one collision that occured this frame.
spherePositionPredictions | The prediction of the position at the current frame of each sphere (in this case of the last frame). |
contactPoint | The contact point of the collision. |
collisionNormal | The normal of the collision. |
solverStep | The current iteration of the constraint solving step. |
void GuidewireSim.CollisionSolvingStep.SolveCollisionConstraints | ( | Vector3[] | spherePositionPredictions, |
int | solverStep, | ||
int | constraintSolverSteps | ||
) |
Is responsible for executing one iteration of the constraint solving step for the collision constraint of each collision of this frame.
spherePositionPredictions | The prediction of the position at the current frame of each sphere (in this case of the last frame). |
solverStep | The current iteration of the constraint solving step. |
constraintSolverSteps | The total number of solver steps of the constraint solving step. |
|
private |
The component CollisionHandler that tracks all collisions.
|
private |
A margin by which a colliding element of the guidewire is set away from the object colliding with in the direction of the normal.
|
private |
The collision constraint stiffness parameter.
|
private |
The correction of spherePositionPrediction
in method SolveCollisionConstraint().
|
private |
|
private |
The component MathHelper that provides math related helper functions.
|
private |
The radius of a sphere of the guidewire.