Public Member Functions | |
void | RegisterCollision (Transform sphere, int sphereID, Vector3 contactPoint, Vector3 collisionNormal) |
void | ResetRegisteredCollisions () |
void | SetCollidersToPredictions (int spheresCount, Vector3[] spherePositionPredictions, Vector3[] spherePositions) |
Public Attributes | |
List< CollisionPair > | registeredCollisions |
All collisions that occured between the last and the current frame in OnTriggerEnter. More... | |
SphereCollider[] | sphereColliders |
Private Member Functions | |
void | Start () |
Private Attributes | |
float | sphereRadius = 5f |
The radius of the sphere elements of the guidewire. More... | |
This class manages all collisions that should be resolved, i.e. the collisions of the last frame.
void GuidewireSim.CollisionHandler.RegisterCollision | ( | Transform | sphere, |
int | sphereID, | ||
Vector3 | contactPoint, | ||
Vector3 | collisionNormal | ||
) |
Registers a collision by adding it to registeredCollisions.
sphere | The sphere of the guidewire that collided. |
sphereID | The unique ID of sphere . |
contactPoint | The contact point of the collision. |
collisionNormal | The normal of the collision. |
void GuidewireSim.CollisionHandler.ResetRegisteredCollisions | ( | ) |
Clears the list of all registered collisions.
void GuidewireSim.CollisionHandler.SetCollidersToPredictions | ( | int | spheresCount, |
Vector3[] | spherePositionPredictions, | ||
Vector3[] | spherePositions | ||
) |
Sets the position of the collider of each sphere to the sphere's position prediction.
spheresCount | The count of all spheres of the guidewire. Equals the length of spherePositionPredictions . |
spherePositionPredictions | The prediction of the position at the current frame of each sphere (in this case of the last frame). |
spherePositions | The position at the current frame of each sphere. |
|
private |
List<CollisionPair> GuidewireSim.CollisionHandler.registeredCollisions |
All collisions that occured between the last and the current frame in OnTriggerEnter.
SphereCollider [] GuidewireSim.CollisionHandler.sphereColliders |
Each element stores a reference to the SpherCollider of the respective element in spheres
in SimulationLoop.
spheres
in SimulationLoop.
|
private |
The radius of the sphere elements of the guidewire.