Simulating Guidewires in Blood Vessels using Cosserat Rod Theory
 
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< CollisionPairregisteredCollisions
 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
sphereThe sphere of the guidewire that collided.
sphereIDThe unique ID of sphere.
contactPointThe contact point of the collision.
collisionNormalThe 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
spheresCountThe count of all spheres of the guidewire. Equals the length of spherePositionPredictions.
spherePositionPredictionsThe prediction of the position at the current frame of each sphere (in this case of the last frame).
spherePositionsThe 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: