Impact CFX API 1.5.5
Comprehensive API documentation for Impact CFX - Collision Effects System
Loading...
Searching...
No Matches
ImpactCFX.ImpactCFXGlobal Class Reference

Global class for managing and interfacing with the active Impact CFX Manager instance. More...

Static Public Member Functions

static void SetInstance (ImpactCFXManager impactCFXManager)
 Sets the active Impact CFX Manager instance.
 
static ImpactCFXManager GetInstance ()
 Gets the currently active Impact CFX Manager instance.
 
static bool TryGetInstance (out ImpactCFXManager instance)
 Attempts to get the currently active Impact CFX Manager instance.
 
static void ClearInstance ()
 Clears the active Impact CFX Manager instance.
 
static void ClearInstance (ImpactCFXManager impactCFXManager)
 Clears the active Impact CFX Manager instance if it matches the given instance. This is to account for switching between different instances.
 
static void RegisterMaterials (ImpactMaterialRegistry materials)
 Registers a list of materials from a registry with the impact manager to convert them into data structures suitable for use in jobs.
 
static void RegisterMaterials (IEnumerable< ImpactMaterialAuthoring > materials)
 Registers a list of materials with the impact manager to convert them into data structures suitable for use in jobs.
 
static void RegisterMaterial (ImpactMaterialAuthoring material)
 Registers a single material with the impact manager to convert it into data structures suitable for use in jobs.
 
static void ClearAllRegistered ()
 Completely disposes of and destroys all material and effect data and objects currently registered in the impact manager.
 
static void FindObjectsAndRegisterMaterials ()
 Finds all Impact Objects in the active scene and forces them to register their materials.
 
static bool CanQueueCollision (CollisionType collisionType, int materialCount)
 Does the impact manager have the capacity to queue a collision of the given type? This is useful to abort early to save processing.
 
static void QueueCollision (IImpactObject triggerObject, IImpactObject hitObject, ImpactContactPoint contactPoint, CollisionType collisionType, int triggerObjectMaterialCount, int hitObjectMaterialCount, CollisionVelocityMethod collisionVelocityMethod, ImpactMaterialAuthoring triggerFallbackMaterial=default, ImpactTagMask hitFallbackTags=default)
 Queues a collision between 2 objects when the other object has an impact object component.
 
static void QueueCollision (IImpactObject triggerObject, ImpactObjectData hitObjectData, ImpactContactPoint contactPoint, CollisionType collisionType, int triggerObjectMaterialCount, CollisionVelocityMethod collisionVelocityMethod, ImpactMaterialAuthoring triggerFallbackMaterial=default)
 Queues a collision using basic data for the object that was hit.
 
static void QueueCollision (ImpactObjectData triggerObjectData, IImpactObject hitObject, ImpactContactPoint contactPoint, CollisionType collisionType, int hitObjectMaterialCount, CollisionVelocityMethod collisionVelocityMethod, ImpactTagMask hitFallbackTags=default)
 Queues a collision using basic data for the object triggering the collision.
 
static void QueueCollision (ImpactObjectData triggerObjectData, ImpactObjectData hitObjectData, ImpactContactPoint contactPoint, CollisionType collisionType, CollisionVelocityMethod collisionVelocityMethod)
 Queues a collision using basic data for both the object triggering the collision and the object that was hit.
 
static bool TryGetEffectProcessor< T > (out T effectProcessor)
 Try to get the effect processor of the given type.
 
static bool TryGetMaterialProcessor< T > (out T materialProcessor)
 Try to get the material processor of the given type.
 
static void ResetAllEffectProcessors ()
 Resets all effect processors controlled by the active manager instance.
 

Properties

static bool HasInstance [get]
 Is there an active Impact CFX Manager instance?
 

Detailed Description

Global class for managing and interfacing with the active Impact CFX Manager instance.

Member Function Documentation

◆ CanQueueCollision()

static bool ImpactCFX.ImpactCFXGlobal.CanQueueCollision ( CollisionType collisionType,
int materialCount )
static

Does the impact manager have the capacity to queue a collision of the given type? This is useful to abort early to save processing.

Parameters
collisionTypeThe collision type.
materialCountThe number of materials that will need to be processed for the collision.

◆ GetInstance()

static ImpactCFXManager ImpactCFX.ImpactCFXGlobal.GetInstance ( )
static

Gets the currently active Impact CFX Manager instance.

Returns
The currently active Impact CFX Manager instance, which may be null.

◆ QueueCollision() [1/4]

static void ImpactCFX.ImpactCFXGlobal.QueueCollision ( IImpactObject triggerObject,
IImpactObject hitObject,
ImpactContactPoint contactPoint,
CollisionType collisionType,
int triggerObjectMaterialCount,
int hitObjectMaterialCount,
CollisionVelocityMethod collisionVelocityMethod,
ImpactMaterialAuthoring triggerFallbackMaterial = default,
ImpactTagMask hitFallbackTags = default )
static

Queues a collision between 2 objects when the other object has an impact object component.

Parameters
triggerObjectThe object that triggered the collision. This object will be responsible for playing effects.
hitObjectThe object being collided with.
contactPointThe contact point of the collision.
collisionTypeThe type of collision.
triggerObjectMaterialCountThe number of materials to get for the object that triggered the collision.
hitObjectMaterialCountThe number of materials to get for the object that was hit.
collisionVelocityMethodThe method to use for calculating the collision velocity.
triggerFallbackMaterialOptional fallback material to use if no material can be found on the trigger object.
hitFallbackTagsOptional fallback tags to use if no material can be found on the hit object.

◆ QueueCollision() [2/4]

static void ImpactCFX.ImpactCFXGlobal.QueueCollision ( IImpactObject triggerObject,
ImpactObjectData hitObjectData,
ImpactContactPoint contactPoint,
CollisionType collisionType,
int triggerObjectMaterialCount,
CollisionVelocityMethod collisionVelocityMethod,
ImpactMaterialAuthoring triggerFallbackMaterial = default )
static

Queues a collision using basic data for the object that was hit.

Parameters
triggerObjectThe object that triggered the collision. This object will be responsible for playing effects.
hitObjectDataBasic data for the object being collided with.
contactPointThe contact point of the collision.
collisionTypeThe type of collision.
triggerObjectMaterialCountThe number of materials to get for the object that triggered the collision.
collisionVelocityMethodThe method to use for calculating the collision velocity.
triggerFallbackMaterialOptional fallback material to use if no material can be found on the trigger object.

◆ QueueCollision() [3/4]

static void ImpactCFX.ImpactCFXGlobal.QueueCollision ( ImpactObjectData triggerObjectData,
IImpactObject hitObject,
ImpactContactPoint contactPoint,
CollisionType collisionType,
int hitObjectMaterialCount,
CollisionVelocityMethod collisionVelocityMethod,
ImpactTagMask hitFallbackTags = default )
static

Queues a collision using basic data for the object triggering the collision.

Parameters
triggerObjectDataBasic data for the object that triggered the collision. This object will be responsible for playing effects.
hitObjectThe object being collided with.
contactPointThe contact point of the collision.
collisionTypeThe type of collision.
collisionVelocityMethodThe method to use for calculating the collision velocity.
hitFallbackTagsOptional fallback tags to use if no material can be found on the hit object.

◆ QueueCollision() [4/4]

static void ImpactCFX.ImpactCFXGlobal.QueueCollision ( ImpactObjectData triggerObjectData,
ImpactObjectData hitObjectData,
ImpactContactPoint contactPoint,
CollisionType collisionType,
CollisionVelocityMethod collisionVelocityMethod )
static

Queues a collision using basic data for both the object triggering the collision and the object that was hit.

Parameters
triggerObjectDataBasic data for the object that triggered the collision. This object will be responsible for playing effects.
hitObjectDataBasic data for the object being collided with.
contactPointThe contact point of the collision.
collisionTypeThe type of collision.
collisionVelocityMethodThe method to use for calculating the collision velocity.

◆ RegisterMaterial()

static void ImpactCFX.ImpactCFXGlobal.RegisterMaterial ( ImpactMaterialAuthoring material)
static

Registers a single material with the impact manager to convert it into data structures suitable for use in jobs.

Parameters
materialThe material being registered.

◆ RegisterMaterials() [1/2]

static void ImpactCFX.ImpactCFXGlobal.RegisterMaterials ( IEnumerable< ImpactMaterialAuthoring > materials)
static

Registers a list of materials with the impact manager to convert them into data structures suitable for use in jobs.

Parameters
materialsThe materials being registered.

◆ RegisterMaterials() [2/2]

static void ImpactCFX.ImpactCFXGlobal.RegisterMaterials ( ImpactMaterialRegistry materials)
static

Registers a list of materials from a registry with the impact manager to convert them into data structures suitable for use in jobs.

Parameters
materialsThe material registry containing the materials to be registered.

◆ TryGetEffectProcessor< T >()

static bool ImpactCFX.ImpactCFXGlobal.TryGetEffectProcessor< T > ( out T effectProcessor)
static

Try to get the effect processor of the given type.

Template Parameters
TThe type of effect processor.
Parameters
effectProcessorThe effect processor that was found, if any.
Returns
True if an effect processor matching the given type was found. False otherwise.
Type Constraints
T :ImpactEffectProcessorBase 

◆ TryGetInstance()

static bool ImpactCFX.ImpactCFXGlobal.TryGetInstance ( out ImpactCFXManager instance)
static

Attempts to get the currently active Impact CFX Manager instance.

Parameters
instanceThe currently active Impact CFX Manager instance, if there is one.
Returns
True if there is an active instance, false otherwise.

◆ TryGetMaterialProcessor< T >()

static bool ImpactCFX.ImpactCFXGlobal.TryGetMaterialProcessor< T > ( out T materialProcessor)
static

Try to get the material processor of the given type.

Template Parameters
TThe type of effect processor.
Parameters
materialProcessorThe material processor that was found, if any.
Returns
True if an material processor matching the given type was found. False otherwise.
Type Constraints
T :ImpactMaterialProcessorBase