Impact Interaction System API
Impact.ImpactManager Class Reference

Singleton class for managing Impact configuration, material mapping, and handling interaction processing. More...

Inheritance diagram for Impact.ImpactManager:

Public Member Functions

void Initialize ()
 Set up all needed manager data including the buffer arrays and material mapping data.
 
bool HasReachedPhysicsInteractionsLimit ()
 Checks if the current physics interaction count has been reached. More...
 
void IncrementPhysicsInteractionsLimit ()
 Increments the physics interaction count.
 
bool HasReachedContinuousInteractionLimit ()
 Has the maximum number of active continuous interactions been reached? More...
 
bool TryGetImpactMaterialFromMapping (Collider collider, out IImpactMaterial impactMaterial)
 Try to get an Impact Material from the Material Mapping using the given Collider. More...
 
bool TryGetImpactMaterialFromMapping (Collider2D collider2d, out IImpactMaterial impactMaterial)
 Try to get an Impact Material from the Material Mapping using the given Collider2D. More...
 
bool TryGetImpactMaterialFromMapping (int physicsMaterialInstanceId, out IImpactMaterial impactMaterial)
 Try to get an Impact Material from the Material Mapping using the given Physics Material instance ID. More...
 
void ProcessInteraction< T > (T interactionData, IImpactMaterial impactMaterial, IImpactObject impactObject)
 Process interaction data using the Impact Material and an optional Impact Object that the interaction originated from. More...
 
void ProcessContinuousInteraction< T > (T interactionData, IImpactObject impactObject)
 Process a continuous interaction using the interaction data and the given Impact Object. The primary material at the interaction point will be used. More...
 
void ProcessContinuousInteraction< T > (T interactionData, IImpactMaterial material, IImpactObject impactObject)
 Process a continuous interaction using the interaction data, an Impact Material, and an optional Impact Object that the interaction originated from. More...
 
void AddOrUpdateContinuousInteractionResult (IImpactObject impactObject, IContinuousInteractionResult result)
 Adds or updates the given continuous interaction result to the active continuous interaction results, if able. More...
 
bool HasActiveContinuousInteractionWithKey (long key)
 
ClassPool CreateInteractionResultPool< T > (string key)
 Creates a new Interaction Result pool with the given key and size. More...
 
bool TryGetInteractionResultFromPool< T > (string key, out T obj)
 Attempts to get an available empty interaction result from the pool with the specified key. More...
 

Properties

IInteractionResult[] InteractionResultBuffer [get]
 Shared buffer for retrieving interaction results from Impact Materials.
 
ImpactMaterialComposition[] MaterialCompositionBuffer [get]
 Shared buffer for retrieving material composition.
 
bool UseMaterialMapping [get, set]
 Is the material mapping feature enabled in the configuration?
 

Detailed Description

Singleton class for managing Impact configuration, material mapping, and handling interaction processing.

Member Function Documentation

◆ AddOrUpdateContinuousInteractionResult()

void Impact.ImpactManager.AddOrUpdateContinuousInteractionResult ( IImpactObject  impactObject,
IContinuousInteractionResult  result 
)

Adds or updates the given continuous interaction result to the active continuous interaction results, if able.

Parameters
impactObjectThe impact object the result is being sent from.
resultThe new continuous interaction result.

◆ CreateInteractionResultPool< T >()

ClassPool Impact.ImpactManager.CreateInteractionResultPool< T > ( string  key)

Creates a new Interaction Result pool with the given key and size.

Template Parameters
TThe IPoolable type to use.
Parameters
keyThe name of the pool, used to retrieve objects.
Returns
The newly created pool, or the existing pool if there is one with the same key.
Type Constraints
T :class 
T :IPoolable 
T :new() 

◆ HasReachedContinuousInteractionLimit()

bool Impact.ImpactManager.HasReachedContinuousInteractionLimit ( )

Has the maximum number of active continuous interactions been reached?

Returns
True if the limit has been reached, False otherwise.

◆ HasReachedPhysicsInteractionsLimit()

bool Impact.ImpactManager.HasReachedPhysicsInteractionsLimit ( )

Checks if the current physics interaction count has been reached.

Returns
True if the limit has been reached, false otherwise.

◆ ProcessContinuousInteraction< T >() [1/2]

void Impact.ImpactManager.ProcessContinuousInteraction< T > ( interactionData,
IImpactMaterial  material,
IImpactObject  impactObject 
)

Process a continuous interaction using the interaction data, an Impact Material, and an optional Impact Object that the interaction originated from.

Parameters
interactionDataThe interaction data to process.
impactMaterialThe Impact Material to get interaction results from.
impactObjectAn optional Impact Object that the interaction originated from.
Type Constraints
T :IInteractionData 

◆ ProcessContinuousInteraction< T >() [2/2]

void Impact.ImpactManager.ProcessContinuousInteraction< T > ( interactionData,
IImpactObject  impactObject 
)

Process a continuous interaction using the interaction data and the given Impact Object. The primary material at the interaction point will be used.

Parameters
interactionDataThe interaction data to process.
impactObjectThe Impact Object that an Impact Material will be retrieved from.
Type Constraints
T :IInteractionData 

◆ ProcessInteraction< T >()

void Impact.ImpactManager.ProcessInteraction< T > ( interactionData,
IImpactMaterial  impactMaterial,
IImpactObject  impactObject 
)

Process interaction data using the Impact Material and an optional Impact Object that the interaction originated from.

Parameters
interactionDataThe interaction data to process.
impactMaterialThe Impact Material to get interaction results from.
impactObjectAn optional Impact Object that the interaction originated from.
Type Constraints
T :IInteractionData 

◆ TryGetImpactMaterialFromMapping() [1/3]

bool Impact.ImpactManager.TryGetImpactMaterialFromMapping ( Collider  collider,
out IImpactMaterial  impactMaterial 
)

Try to get an Impact Material from the Material Mapping using the given Collider.

Parameters
colliderThe collider that has the Physic Material to get a mapping for.
impactMaterialThe material that was found in the mapping, if one was found. Null otherwise.
Returns
True if a matching map was found, False otherwise.

◆ TryGetImpactMaterialFromMapping() [2/3]

bool Impact.ImpactManager.TryGetImpactMaterialFromMapping ( Collider2D  collider2d,
out IImpactMaterial  impactMaterial 
)

Try to get an Impact Material from the Material Mapping using the given Collider2D.

Parameters
collider2dThe collider that has the Physics Material 2D to get a mapping for.
impactMaterialThe material that was found in the mapping, if one was found. Null otherwise.
Returns
True if a matching map was found, False otherwise.

◆ TryGetImpactMaterialFromMapping() [3/3]

bool Impact.ImpactManager.TryGetImpactMaterialFromMapping ( int  physicsMaterialInstanceId,
out IImpactMaterial  impactMaterial 
)

Try to get an Impact Material from the Material Mapping using the given Physics Material instance ID.

Parameters
physicsMaterialInstanceIdThe instance ID of the physics material (3D or 2D).
impactMaterialThe material that was found in the mapping, if one was found. Null otherwise.
Returns
True if a matching map was found, False otherwise.

◆ TryGetInteractionResultFromPool< T >()

bool Impact.ImpactManager.TryGetInteractionResultFromPool< T > ( string  key,
out T  obj 
)

Attempts to get an available empty interaction result from the pool with the specified key.

Template Parameters
TThe IPoolable type to get.
Parameters
keyThe name of the pool.
objThe returned result, if one was found.
Returns
True if an available result was found. False otherwise.
Type Constraints
T :class 
T :IPoolable 
T :new()