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

Wrapper class for 3D and 2D rigidbodies that handles tracking the rigidbody state. More...

Public Member Functions

 RigidbodyContainer ()
 Creates an empty wrapper with no reference to a rigidbody.
 
 RigidbodyContainer (GameObject gameObject)
 Creates a wrapper for the given GameObject that has either a Rigidbody or Rigidbody2D component.
 
void FindRigidbody (GameObject gameObject)
 Attempts to find a Rigidbody or Rigidbody2D to reference from the given GameObject or one of its parents.
 
void SetRigidbody (Rigidbody rigidbody)
 Sets the 3D physics rigidbody referenced by this container.
 
void SetRigidbody2D (Rigidbody2D rigidbody)
 Sets the 2D physics rigidbody referenced by this container.
 
void ClearRigidbody ()
 Clears the rigidbody reference from this container (does not destroy the rigidbody).
 
void SyncRigidbodyData ()
 Syncs the cached rigidbody data with the current rigidbody state.
 
RigidbodyData GetRigidbodyData ()
 Gets the full rigidbody data with both previous and current states.
 
RigidbodyStateData GetCurrentRigidbodyState ()
 Gets the current rigidbody state, using the values directly from the rigidbody.
 
RigidbodyStateData GetPreviousRigidbodyState ()
 Gets the previous state of the rigidbody from the last time it was synced (i.e. the previous frame).
 

Detailed Description

Wrapper class for 3D and 2D rigidbodies that handles tracking the rigidbody state.

Constructor & Destructor Documentation

◆ RigidbodyContainer()

ImpactCFX.RigidbodyContainer.RigidbodyContainer ( GameObject  gameObject)

Creates a wrapper for the given GameObject that has either a Rigidbody or Rigidbody2D component.

Parameters
gameObjectA GameObject that has either a Rigidbody or Rigidbody2D component

Member Function Documentation

◆ FindRigidbody()

void ImpactCFX.RigidbodyContainer.FindRigidbody ( GameObject  gameObject)

Attempts to find a Rigidbody or Rigidbody2D to reference from the given GameObject or one of its parents.

Parameters
gameObjectThe GameObject to use to find a rigidbody.

◆ SetRigidbody()

void ImpactCFX.RigidbodyContainer.SetRigidbody ( Rigidbody  rigidbody)

Sets the 3D physics rigidbody referenced by this container.

Parameters
rigidbodyThe rigidbody to reference.

◆ SetRigidbody2D()

void ImpactCFX.RigidbodyContainer.SetRigidbody2D ( Rigidbody2D  rigidbody)

Sets the 2D physics rigidbody referenced by this container.

Parameters
rigidbodyThe rigidbody to reference.