Loading...
Searching...
No Matches
GuidewireSim.CollisionHandler Class Reference
Inheritance diagram for GuidewireSim.CollisionHandler:

## 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...

## Detailed Description

This class manages all collisions that should be resolved, i.e. the collisions of the last frame.

## Member Function Documentation

## RegisterCollision()

void GuidewireSim.CollisionHandler.RegisterCollision | ( | Transform | sphere,
|  | int | sphereID,
|  | Vector3 | contactPoint,
|  | Vector3 | collisionNormal
| ) |  |

Registers a collision by adding it to registeredCollisions.

Parameters

  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.

## ResetRegisteredCollisions()

void GuidewireSim.CollisionHandler.ResetRegisteredCollisions | ( |  | ) |

Clears the list of all registered collisions.

## SetCollidersToPredictions()

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.

Note
  The position of the collider is implicitly set by setting the colliders center argument.

Parameters

  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.

## Start()

void GuidewireSim.CollisionHandler.Start | ( |  | ) |

private

## Member Data Documentation

## registeredCollisions

List<CollisionPair> GuidewireSim.CollisionHandler.registeredCollisions

All collisions that occured between the last and the current frame in OnTriggerEnter.

## sphereColliders

SphereCollider [] GuidewireSim.CollisionHandler.sphereColliders

Each element stores a reference to the SpherCollider of the respective element in `spheres` in SimulationLoop.

Example
  The second element in this list is the SphereCollider corresponding to the sphere GameObject that is referenced in the second element of `spheres` in SimulationLoop.

## sphereRadius

float GuidewireSim.CollisionHandler.sphereRadius = 5f

private

The radius of the sphere elements of the guidewire.

The documentation for this class was generated from the following file:

- CollisionHandler.cs